[SDL] OSX: fullscreen openGL vbl syncing?
Darrell Walisser
walisser at mac.com
Wed Dec 18 13:48:00 PST 2002
On Wednesday, December 18, 2002, at 03:01 PM, sdl-request at libsdl.org
wrote:
> From: arekkusu <arekkusu at mac.com>
> To: sdl at libsdl.org
> Subject: [SDL] OSX: fullscreen openGL vbl syncing?
> Reply-To: sdl at libsdl.org
>
> I have a question about SDL's behavior on OSX. Apologies if this is a
> known issue... I can't see any bug
> reporting forum on the site... perhaps Max Horn / Darrell Walisser can
> clue me in??
>
> Under Mac OS X, when creating a full screen double buffered context
> using openGL (for filtering and
> aspect scaling of 2D content, in my case) does SDL provide VBL
> synchronization?
>
By default, OpenGL contexts don't use VBL sync.
> I know that AGL can do what I want, but looking at SDL_dspvideo.c it
> appears DrawSprocket is being used
> and I am unsure how well this is supported on OS X.
I'd recommend against using DrawSprocket on OS X unless you really need
to have a Carbon application and absolutely can't have 2 separate
binaries for either OS.
There are hacks to enable the features you want, but that involves
writing platform-specific code. They involve first calling
SDL_SetVideoMode(), then using the AGL(OS 9/Carbon) or CGL(OS X) to set
the swap parameter.
> Also looking at
> some games that use SDL (GLTron,
> ScummVM) there is very apparent tearing in fullscreen mode.
>
> If this is a known bug/limitation of SDL on OS X, are there plans for a
> fix?
There is no GL attribute in SDL for this. We would have to add:
SDL_GL_SWAP_INTERVAL
to the API, which could be 0,1-n which controls the number of retraces
to wait for between swaps. Then, we could easily add it to the OS 9
and OS X versions of SDL. There are also other interesting attributes
like multisampling (for antialiasing), that could be handled in the
same manor. Since Mac OS X doesn't have a system control panel to tweak
these settings (like windows does) this is really the only way to do
certain things.
More information about the SDL
mailing list