Skip to content

Commit

Permalink
Allow testalpha.c to toggle windowed/fullscreen mode.
Browse files Browse the repository at this point in the history
This is to help track down bugs in the updated Mac OS X video target.
  • Loading branch information
icculus committed Sep 16, 2011
1 parent 7d505f7 commit 968723f
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions test/testalpha.c
Expand Up @@ -505,14 +505,24 @@ fprintf(stderr, "Slept %d ticks\n", (SDL_GetTicks()-ticks));
}
break;
case SDL_KEYDOWN:
#ifndef _WIN32_WCE
#ifdef _WIN32_WCE
// there is no ESC key at all
done = 1;
#else
if ( event.key.keysym.sym == SDLK_ESCAPE ) {
done = 1;
} else if (event.key.keysym.sym == SDLK_t) {
videoflags ^= SDL_FULLSCREEN;
screen = SDL_SetVideoMode(w, h, video_bpp, videoflags);
if ( screen == NULL ) {
fprintf(stderr, "Couldn't toggle video mode: %s\n",
SDL_GetError());
quit(2);
}
FillBackground(screen);
}
#else
// there is no ESC key at all
done = 1;
#endif

break;
case SDL_QUIT:
done = 1;
Expand Down

0 comments on commit 968723f

Please sign in to comment.