So I’m currently using software mode for both full screen and windowed mode.
It appears that when I do my UpdateRect, there’s a synchronous lag, because SDL
must wait for the vertical synch, then it must do a memcpy of the screen’s pixel
data.
Would it be possible to eliminate the wait for synch and/or the memcpy wait by
setting up software modes to allow double buffering, combined with a simple
flip? Is this just a potential feature that SDL is missing, or is my logic
wrong and there would be no gain to be had here?
Would it be possible to eliminate the wait for synch and/or the memcpy wait by
setting up software modes to allow double buffering, combined with a simple
flip? Is this just a potential feature that SDL is missing, or is my logic
wrong and there would be no gain to be had here?
On most (all?) platforms, SDL doesn’t wait for vsync. However, you might
see bigger performance gains if you either use SDL_UpdateRects() on all
parts you need updated at once, or just do
SDL_Flip()/SDL_UpdateRect(screen,0,0,0,0) once per frame instead.
Other discussions about precoverting to display format and favoring
OpenGL still apply, since this tends to be the usual expensive places, too.
–ryan.