flushing a graphics context in SDL.
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..
How do I then display what I've been drawing using the blit command? Apparently nothing happens without anything extra..
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...
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...
Mark Bishop
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| CGContextFlush: invalid context with awt.Toolkit and awt.Graphics | Tools10 | 1 | 2,934 |
Jun 10, 2007 04:07 PM Last Post: Tools10 |
|
| Full screen context doesn't remain the current context | Malarkey | 3 | 2,958 |
Feb 1, 2007 05:27 PM Last Post: OneSadCookie |
|

