![]() |
|
flushing a graphics context in SDL. - Printable Version +- iDevGames Forums (http://www.idevgames.com/forums) +-- Forum: Development Zone (/forum-3.html) +--- Forum: Graphics & Audio Programming (/forum-9.html) +--- Thread: flushing a graphics context in SDL. (/thread-5438.html) |
flushing a graphics context in SDL. - dave05 - Jun 9, 2005 10:18 AM 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.. flushing a graphics context in SDL. - sealfin - Jun 9, 2005 01:36 PM 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 ![]() 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 ![]() Hope that helps... |