]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/batch_backend.cpp
Move all OpenGL-specific code to a separate directory
[libs/gl.git] / source / backends / opengl / batch_backend.cpp
diff --git a/source/backends/opengl/batch_backend.cpp b/source/backends/opengl/batch_backend.cpp
new file mode 100644 (file)
index 0000000..f44d6b8
--- /dev/null
@@ -0,0 +1,25 @@
+#include <msp/gl/extensions/msp_primitive_restart.h>
+#include "batch_backend.h"
+
+namespace Msp {
+namespace GL {
+
+OpenGLBatch::OpenGLBatch(PrimitiveType t):
+       gl_prim_type(GL::get_gl_primitive_type(t)),
+       gl_index_type(GL_UNSIGNED_SHORT)
+{ }
+
+bool OpenGLBatch::check_restart(bool require)
+{
+       if(require)
+               static Require _req(MSP_primitive_restart);
+       return MSP_primitive_restart;
+}
+
+void OpenGLBatch::set_index_type(DataType t)
+{
+       gl_index_type = get_gl_type(t);
+}
+
+} // namespace GL
+} // namespace Msp