Quartz driver: Correctly handle SDL_DOUBLEBUF|SDL_FULLSCREEN when the
authorRyan C. Gordon <icculus@icculus.org>
Mon, 02 Jan 2006 12:37:40 +0000
changeset 12199a7a016d5a71
parent 1218 057d313e36a2
child 1220 ca2f0da7b708
Quartz driver: Correctly handle SDL_DOUBLEBUF|SDL_FULLSCREEN when the
resolution is too small and thus emulated by SDL.

Fixes http://www.devolution.com/pipermail/sdl/2005-December/071765.html ...
src/video/quartz/SDL_QuartzVideo.m
     1.1 --- a/src/video/quartz/SDL_QuartzVideo.m	Mon Jan 02 10:49:37 2006 +0000
     1.2 +++ b/src/video/quartz/SDL_QuartzVideo.m	Mon Jan 02 12:37:40 2006 +0000
     1.3 @@ -975,8 +975,14 @@
     1.4          if (quit_thread)
     1.5              return 0;
     1.6                  
     1.7 -        dst = CGDisplayBaseAddress (display_id);
     1.8 -        src = current_buffer;
     1.9 +        /*
    1.10 +         * We have to add SDL_VideoSurface->offset here, since we might be a
    1.11 +         *  smaller surface in the center of the framebuffer (you asked for
    1.12 +         *  a fullscreen resolution smaller than the hardware could supply
    1.13 +         *  so SDL is centering it in a bigger resolution)...
    1.14 +         */
    1.15 +        dst = CGDisplayBaseAddress (display_id) + SDL_VideoSurface->offset;
    1.16 +        src = current_buffer + SDL_VideoSurface->offset;
    1.17          len = SDL_VideoSurface->w * SDL_VideoSurface->format->BytesPerPixel;
    1.18          h = SDL_VideoSurface->h;
    1.19          skip = SDL_VideoSurface->pitch;