Check return value from MOJOSHADER_glInit(). trunk
authorRyan C. Gordon <icculus@icculus.org>
Sun, 27 Apr 2008 05:40:53 -0400
branchtrunk
changeset 227 c6192a343fef
parent 226 4a2b3d0b535f
child 228 fa70fd53eb59
Check return value from MOJOSHADER_glInit().
finderrors.c
--- a/finderrors.c	Sun Apr 27 05:34:33 2008 -0400
+++ b/finderrors.c	Sun Apr 27 05:40:53 2008 -0400
@@ -115,7 +115,12 @@
         SDL_GL_LoadLibrary(NULL);
         SDL_SetVideoMode(640, 480, 0, SDL_OPENGL);
         glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
-        MOJOSHADER_glInit(profile, SDL_GL_GetProcAddress, 0, 0, 0);
+        if (!MOJOSHADER_glInit(profile, SDL_GL_GetProcAddress, 0, 0, 0))
+        {
+            printf("MOJOSHADER_glInit() fail: %s\n", MOJOSHADER_glGetError());
+            SDL_Quit();
+            return 1;
+        } // if
         #endif
 
         for (i = 2; i < argc; i++)