Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
finderrors.c now pumps event queue and paints the SDL window.
Now you can ctrl-c out on the Mac.

--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 22, 2008
1 parent ca8b549 commit aadf631
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions finderrors.c
Expand Up @@ -72,9 +72,27 @@ static int do_dir(const char *dname, const char *profile)
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;

Expand Down Expand Up @@ -132,6 +150,7 @@ int main(int argc, char **argv)
#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];
Expand Down

0 comments on commit aadf631

Please sign in to comment.