[vlc-commits] opengl: fix version comparison

Rémi Denis-Courmont git at videolan.org
Sun Jul 1 14:19:36 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Jul  1 15:19:26 2012 +0300| [a6a09908ceb0f1bb8bb44c1a51e28eb395567424] | committer: Rémi Denis-Courmont

opengl: fix version comparison

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=a6a09908ceb0f1bb8bb44c1a51e28eb395567424
---

 modules/video_output/opengl.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 33de6b3..5678192 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -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);
 



More information about the vlc-commits mailing list