finderrors.c now pumps event queue and paints the SDL window. trunk
authorRyan C. Gordon <icculus@icculus.org>
Mon, 21 Apr 2008 23:54:37 -0400
branchtrunk
changeset 172 f81c6cb14140
parent 171 4bf769d41b01
child 173 743dbd0e03d8
finderrors.c now pumps event queue and paints the SDL window. Now you can ctrl-c out on the Mac.
finderrors.c
--- a/finderrors.c	Mon Apr 21 23:45:27 2008 -0400
+++ b/finderrors.c	Mon Apr 21 23:54:37 2008 -0400
@@ -72,9 +72,27 @@
     DIR *dirp = opendir(dname);
     if (dirp != NULL)
     {
+        int do_quit = 0;
         struct dirent *dent;
         while ((dent = readdir(dirp)) != NULL)
         {
+            #if FINDERRORS_COMPILE_SHADERS
+            SDL_Event e;  // pump event queue to keep OS happy.
+            while (SDL_PollEvent(&e))
+            {
+                if (e.type == SDL_QUIT)
+                    do_quit = 1;
+            } // while
+            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+            SDL_GL_SwapBuffers();
+            #endif
+
+            if (do_quit)
+            {
+                report("FAIL: user requested quit!\n");
+                break;
+            } // if
+
             if (strstr(dent->d_name, ".bytecode") == NULL)
                 continue;
 
@@ -132,6 +150,7 @@
         #if FINDERRORS_COMPILE_SHADERS
         SDL_Init(SDL_INIT_VIDEO);
         SDL_SetVideoMode(640, 480, 0, SDL_OPENGL);
+        glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
         #endif
 
         const char *profile = argv[1];