Skip to content
Permalink
Browse files

Allow testalpha.c to toggle windowed/fullscreen mode.

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 968723f851e06e9c83a15109b98dfbd88e5ddddb
Showing with 14 additions and 4 deletions.
  1. +14 −4 test/testalpha.c
@@ -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;

0 comments on commit 968723f

Please sign in to comment.