Skip to content
Permalink
Browse files
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 aadf631714d5cff46f3668a5862823b1517227fe
Showing with 19 additions and 0 deletions.
  1. +19 −0 finderrors.c
@@ -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;

@@ -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];

0 comments on commit aadf631

Please sign in to comment.