cogl: Don't bother checking for NPOTs or VBOs on later GLs
authorNeil Roberts <neil@linux.intel.com>
Tue, 17 Nov 2009 17:22:22 +0000 (17:22 +0000)
committerNeil Roberts <neil@linux.intel.com>
Tue, 17 Nov 2009 17:22:22 +0000 (17:22 +0000)
For VBOs, we don't need to check for the extension if the GL version
is greater than 1.5. Non-power-of-two textures are given in 2.0.

We could also assume shader support in GL 2.0 except that the function
names are different from those in the extension so it wouldn't work
well with the current mechanism.

clutter/cogl/cogl/driver/gl/cogl-feature-functions.h
clutter/cogl/cogl/driver/gl/cogl.c

index 8120b64..b6d71a8 100644 (file)
@@ -100,6 +100,8 @@ COGL_FEATURE_FUNCTION (void, glRenderbufferStorageMultisample,
                         GLsizei               height))
 COGL_FEATURE_END ()
 
+/* The function names in OpenGL 2.0 are different so we can't easily
+   just check for GL 2.0 */
 COGL_FEATURE_BEGIN (shaders_glsl, 255, 255,
                     "ARB\0",
                     "shader_objects\0"
@@ -237,7 +239,7 @@ COGL_FEATURE_FUNCTION (void, glUniformMatrix4fv,
 
 COGL_FEATURE_END ()
 
-COGL_FEATURE_BEGIN (vbos, 255, 255,
+COGL_FEATURE_BEGIN (vbos, 1, 5,
                     "ARB\0",
                     "vertex_buffer_object\0",
                     COGL_FEATURE_VBOS)
index d97e810..87b5c2f 100644 (file)
@@ -213,7 +213,8 @@ _cogl_features_init (void)
 
   gl_extensions = (const gchar*) glGetString (GL_EXTENSIONS);
 
-  if (cogl_check_extension ("GL_ARB_texture_non_power_of_two", gl_extensions))
+  if (COGL_CHECK_GL_VERSION (gl_major, gl_minor, 2, 0) ||
+      cogl_check_extension ("GL_ARB_texture_non_power_of_two", gl_extensions))
     {
 #ifdef HAVE_CLUTTER_OSX
       if (really_enable_npot ())