]> git.tdb.fi Git - libs/gl.git/blobdiff - source/batch.cpp
Complete rewrite of extension handling
[libs/gl.git] / source / batch.cpp
index 375c52e9ca25da98131f76924eb457b80bf9f255..afb9787b4d7f8bd7f34c0491120f668efc3c163b 100644 (file)
@@ -2,10 +2,9 @@
 #include "bindable.h"
 #include "buffer.h"
 #include "error.h"
-#include "extension.h"
+#include "ext_draw_range_elements.h"
 #include "nv_primitive_restart.h"
 #include "vertexarray.h"
-#include "version_1_2.h"
 
 using namespace std;
 
@@ -28,7 +27,7 @@ Batch::Batch(PrimitiveType t):
 {
        /* XXX Should probably provide a fallback to glDrawElements since this class
        is pretty much required to render anything. */
-       static RequireVersion _ver(1, 2);
+       static Require _req(EXT_draw_range_elements);
 }
 
 Batch::~Batch()
@@ -165,12 +164,12 @@ void Batch::append(const Batch &other)
        else if(prim_type==POLYGON)
                throw incompatible_data("Batch::append");
        else if(prim_type==TRIANGLE_FAN)
-               static RequireExtension _ext("GL_NV_primitive_restart");
+               static Require _req(NV_primitive_restart);
 
        if(other.data.empty())
                return;
 
-       if(is_supported("GL_NV_primitive_restart"))
+       if(NV_primitive_restart)
        {
                restart = true;
                if(data_type==UNSIGNED_SHORT)