]> git.sesse.net Git - vlc/commitdiff
opengl: fix version comparison
authorRémi Denis-Courmont <remi@remlab.net>
Sun, 1 Jul 2012 12:19:26 +0000 (15:19 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Sun, 1 Jul 2012 12:19:26 +0000 (15:19 +0300)
modules/video_output/opengl.c

index 33de6b33ba5f9844dc10db05050d01151257e3ed..567819269745281b0ec3d819bba231d0302d100a 100644 (file)
@@ -245,9 +245,8 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
     }
 
 
-    const char *ogl_version = glGetString(GL_VERSION);
-    float f_ogl_version = atof(ogl_version);
-    bool supports_shaders = f_ogl_version >= 2.0f;
+    const unsigned char *ogl_version = glGetString(GL_VERSION);
+    bool supports_shaders = strverscmp((const char *)ogl_version, "2.0") >= 0;
     GLint max_texture_units = 0;
     glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &max_texture_units);