#include #include int main(int argc, char** argv) { const int screen_flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL; int i, is_fullscreen; int width = 1920; int height = 1080; if (SDL_Init (SDL_INIT_VIDEO)) { printf("no sdl\n"); return 1; } const SDL_VideoInfo *vi = SDL_GetVideoInfo(); if (!vi) { printf("no GetVideoInfo\n"); return 1; } width = vi->current_w; height = vi->current_h; printf("Fullscreen size: %dx%d\n", width, height); is_fullscreen = 1; for (i=0; i<50; ++i) { is_fullscreen = !is_fullscreen; SDL_SetVideoMode(width, height, 0, (screen_flags | (is_fullscreen?SDL_FULLSCREEN:SDL_RESIZABLE)) ); for (;;) { SDL_Event event; if (!SDL_PollEvent(&event)) break; } } quit: printf("exiting\n"); return 0; }