ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/SDL/video_sdl.cpp
(Generate patch)

Comparing BasiliskII/src/SDL/video_sdl.cpp (file contents):
Revision 1.29 by gbeauche, 2006-05-14T14:11:46Z vs.
Revision 1.31 by asvitkine, 2007-01-22T00:32:25Z

# Line 719 | Line 719 | void driver_base::restore_mouse_accel(vo
719   *  Windowed display driver
720   */
721  
722 + static int SDL_display_opened = FALSE;
723 +
724   // Open display
725   driver_window::driver_window(SDL_monitor_desc &m)
726          : driver_base(m), mouse_grabbed(false)
# Line 730 | Line 732 | driver_window::driver_window(SDL_monitor
732          // Set absolute mouse mode
733          ADBSetRelMouseMode(mouse_grabbed);
734  
735 +        // This is ugly:
736 +        // If we're switching resolutions (ie, not setting it for the first time),
737 +        // there's a bug in SDL where the SDL_Surface created will not be properly
738 +        // setup. The solution is to SDL_Quit() before calling SDL_SetVideoMode for
739 +        // the second time (SDL_SetVideoMode will call SDL_Init() and all will be
740 +        // well). Without this, the video becomes corrupted (at least on Mac OS X),
741 +        // after the resolution switch (for the second and subsequent times).
742 + // EDIT: Ack, this breaks audio!
743 + //      if (SDL_display_opened)
744 + //              SDL_Quit();
745 +
746          // Create surface
747          int depth = sdl_depth_of_video_depth(VIDEO_MODE_DEPTH);
748          if ((s = SDL_SetVideoMode(width, height, depth, SDL_HWSURFACE)) == NULL)
749                  return;
750  
751 +        SDL_display_opened = TRUE;
752 +
753   #ifdef ENABLE_VOSF
754          use_vosf = true;
755          // Allocate memory for frame buffer (SIZE is extended to page-boundary)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines