+
+static void toggle_fullscreen(void)
+{
+ SDL_Surface *newsurf;
+ unsigned int newflags = sdl_flags ^ SDL_FULLSCREEN;
+
+ if(!(newsurf = SDL_SetVideoMode(xsz, ysz, fb_bpp, newflags))) {
+ fprintf(stderr, "failed to go %s\n", newflags & SDL_FULLSCREEN ? "fullscreen" : "windowed");
+ return;
+ }
+
+ fbsurf = newsurf;
+ sdl_flags = newflags;
+}