changeset 16984:94b70ab52695

disable *SwapInterval function when extensions are missing, since it can cause crashes.
author reimar
date Sun, 13 Nov 2005 21:53:26 +0000
parents 4f4b0a763178
children 08cac43f1e38
files libvo/gl_common.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/gl_common.c	Sun Nov 13 20:25:06 2005 +0000
+++ b/libvo/gl_common.c	Sun Nov 13 21:53:26 2005 +0000
@@ -251,6 +251,7 @@
  * \param getProcAddress function to resolve function names, may be NULL
  */
 static void getFunctions(void *(*getProcAddress)(const GLubyte *)) {
+  const char *extensions = glGetString(GL_EXTENSIONS);
   if (!getProcAddress)
     getProcAddress = setNull;
   GenBuffers = getProcAddress("glGenBuffers");
@@ -323,6 +324,9 @@
     ProgramEnvParameter4f = getProcAddress("glProgramEnvParameter4fARB");
   if (!ProgramEnvParameter4f)
     ProgramEnvParameter4f = getProcAddress("glProgramEnvParameter4fNV");
+  if (!extensions || !strstr(extensions, "_swap_control"))
+    SwapInterval = NULL;
+  else {
   SwapInterval = getProcAddress("glXSwapInterval");
   if (!SwapInterval)
     SwapInterval = getProcAddress("glXSwapIntervalEXT");
@@ -334,6 +338,7 @@
     SwapInterval = getProcAddress("wglSwapIntervalEXT");
   if (!SwapInterval)
     SwapInterval = getProcAddress("wglSwapIntervalSGI");
+  }
 }
 
 /**