[107/906] fix opengl version checker

git-svn-id: svn://svn.wobow.com/GStreamer_playground/gst-plugins-gl@534 93df14bb-0f41-7a43-8087-d3e2a2f0e464
This commit is contained in:
Julien Isorce 2008-06-19 23:38:36 +00:00 committed by Matthew Waters
parent 6fe0a756a1
commit 04946b3f1d

View file

@ -497,25 +497,28 @@ gst_gl_display_glutCreateWindow (GstGLDisplay *display)
{
//OpenGL > 2.1.0 and Glew > 1.5.0
GString* opengl_version = g_string_truncate (g_string_new ((gchar*) glGetString (GL_VERSION)), 3);
gfloat opengl_version_f = 0.0f;
gint opengl_version_major = 0.;
gint opengl_version_minor = 0;
GString* glew_version = g_string_truncate (g_string_new ((gchar*) glewGetString (GLEW_VERSION)), 3);
gfloat glew_version_f = 0.0f;
gint glew_version_major = 0.;
gint glew_version_minor = 0;
sscanf(opengl_version->str, "%f", &opengl_version_f);
sscanf(glew_version->str, "%f", &glew_version_f);
sscanf(opengl_version->str, "%d.%d", &opengl_version_major, &opengl_version_minor);
sscanf(glew_version->str, "%d.%d", &glew_version_major, &glew_version_minor);
GST_DEBUG ("GL_VERSION: %s", glGetString (GL_VERSION));
GST_DEBUG ("GLEW_VERSION: %s", glewGetString (GLEW_VERSION));
g_print ("GL_VERSION: %s\n", glGetString (GL_VERSION));
g_print ("GLEW_VERSION: %s\n", glewGetString (GLEW_VERSION));
GST_DEBUG ("GL_VENDOR: %s", glGetString (GL_VENDOR));
GST_DEBUG ("GL_RENDERER: %s", glGetString (GL_RENDERER));
g_print ("GL_VENDOR: %s\n", glGetString (GL_VENDOR));
g_print ("GL_RENDERER: %s\n", glGetString (GL_RENDERER));
g_string_free (opengl_version, TRUE);
g_string_free (glew_version, TRUE);
if (opengl_version_f < 1.4f || glew_version_f < 1.4)
if ( (opengl_version_major < 1 && opengl_version_minor < 4) ||
(glew_version_major < 1 && glew_version_minor < 4) )
{
GST_DEBUG ("Required OpenGL >= 1.4.0 and Glew >= 1.4.0");
g_print ("Required OpenGL >= 1.4.0 and Glew >= 1.4.0\n");
g_assert_not_reached ();
}
}