cogl: Don't bother checking for NPOTs or VBOs on later GLs

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.
This commit is contained in:
Neil Roberts 2009-11-17 17:22:22 +00:00
parent 058d79dce2
commit 2a53b84d18
2 changed files with 5 additions and 2 deletions

View File

@ -100,6 +100,8 @@ COGL_FEATURE_FUNCTION (void, glRenderbufferStorageMultisample,
GLsizei height)) GLsizei height))
COGL_FEATURE_END () 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, COGL_FEATURE_BEGIN (shaders_glsl, 255, 255,
"ARB\0", "ARB\0",
"shader_objects\0" "shader_objects\0"
@ -237,7 +239,7 @@ COGL_FEATURE_FUNCTION (void, glUniformMatrix4fv,
COGL_FEATURE_END () COGL_FEATURE_END ()
COGL_FEATURE_BEGIN (vbos, 255, 255, COGL_FEATURE_BEGIN (vbos, 1, 5,
"ARB\0", "ARB\0",
"vertex_buffer_object\0", "vertex_buffer_object\0",
COGL_FEATURE_VBOS) COGL_FEATURE_VBOS)

View File

@ -213,7 +213,8 @@ _cogl_features_init (void)
gl_extensions = (const gchar*) glGetString (GL_EXTENSIONS); 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 #ifdef HAVE_CLUTTER_OSX
if (really_enable_npot ()) if (really_enable_npot ())