Test for the GL extension, not whether the entry point is NULL.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 24 May 2011 04:38:48 -0400
changeset 1024 dbff93345a84
parent 1023 8f4d16a3b380
child 1025 e3ffb7acae79
Test for the GL extension, not whether the entry point is NULL. (glXGetProcAddress() can legally return a non-NULL pointer...you have to make sure it is safe to call yourself by checking the GL_EXTENSIONS string!)
mojoshader_opengl.c
--- a/mojoshader_opengl.c	Tue May 24 04:35:01 2011 -0400
+++ b/mojoshader_opengl.c	Tue May 24 04:38:48 2011 -0400
@@ -689,7 +689,7 @@
         else if (type == MOJOSHADER_UNIFORM_INT)
         {
             int i;
-            if (ctx->glProgramLocalParameterI4ivNV != NULL)
+            if (ctx->have_GL_NV_gpu_program4)
             {
                 // GL_NV_gpu_program4 has integer uniform loading support.
                 for (i = 0; i < size; i++, srci += 4, loc++)
@@ -710,7 +710,7 @@
         else if (type == MOJOSHADER_UNIFORM_BOOL)
         {
             int i;
-            if (ctx->glProgramLocalParameterI4ivNV != NULL)
+            if (ctx->have_GL_NV_gpu_program4)
             {
                 // GL_NV_gpu_program4 has integer uniform loading support.
                 for (i = 0; i < size; i++, srcb++, loc++)