mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
[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:
parent
49970b27aa
commit
18177e6c46
1 changed files with 163 additions and 160 deletions
|
@ -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 ();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue