flushing a graphics context in SDL.

dave05
Unregistered
 
Post: #1
I read on google somewhere that SDL doesn't support doublebuffering for os X, so the SDL_Flip command is uh, useless....

How do I then display what I've been drawing using the blit command? Apparently nothing happens without anything extra..
Quote this message in a reply
Moderator
Posts: 702
Joined: 2002.04
Post: #2
Okay, I haven't used SDL's own 2D graphics capabilities in... well, over a year now (OpenGL being a lot faster if a little more awkward), so I'm working from probably flawed memory here, but if you don't have a double-buffered 'main' surface, SDL_Flip() just calls SDL_UpdateRect( [everything on the 'main' surface] )...

And even if SDL doesn't 'officially' support double-buffering in OS X, it is pretty easy to achieve double-buffering by just blitting to your own 'offscreen', and then blitting that surface to the 'main' surface Wink

For anything to show up on screen, after blitting every surface you'd like to appear on screen, just call SDL_UpdateRect() on the 'main' surface with the proper parameters Wink

Hope that helps...

Mark Bishop
--
Student and freelance OS X & iOS developer
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  CGContextFlush: invalid context with awt.Toolkit and awt.Graphics Tools10 1 3,807 Jun 10, 2007 04:07 PM
Last Post: Tools10
  Full screen context doesn't remain the current context Malarkey 3 3,640 Feb 1, 2007 05:27 PM
Last Post: OneSadCookie