--- BasiliskII/src/SDL/video_sdl.cpp 2006/05/14 14:11:46 1.29 +++ BasiliskII/src/SDL/video_sdl.cpp 2007/01/22 00:32:25 1.31 @@ -719,6 +719,8 @@ void driver_base::restore_mouse_accel(vo * Windowed display driver */ +static int SDL_display_opened = FALSE; + // Open display driver_window::driver_window(SDL_monitor_desc &m) : driver_base(m), mouse_grabbed(false) @@ -730,11 +732,24 @@ driver_window::driver_window(SDL_monitor // Set absolute mouse mode ADBSetRelMouseMode(mouse_grabbed); + // This is ugly: + // If we're switching resolutions (ie, not setting it for the first time), + // there's a bug in SDL where the SDL_Surface created will not be properly + // setup. The solution is to SDL_Quit() before calling SDL_SetVideoMode for + // the second time (SDL_SetVideoMode will call SDL_Init() and all will be + // well). Without this, the video becomes corrupted (at least on Mac OS X), + // after the resolution switch (for the second and subsequent times). +// EDIT: Ack, this breaks audio! +// if (SDL_display_opened) +// SDL_Quit(); + // Create surface int depth = sdl_depth_of_video_depth(VIDEO_MODE_DEPTH); if ((s = SDL_SetVideoMode(width, height, depth, SDL_HWSURFACE)) == NULL) return; + SDL_display_opened = TRUE; + #ifdef ENABLE_VOSF use_vosf = true; // Allocate memory for frame buffer (SIZE is extended to page-boundary)