I desire to use SDL for visualization of heavy distributed processing. Multiple frames are being rendered simultaneously, with the visualisation trailing just slightly behind ( typically 200ms ). Basically, more than double or triple buffering, I need N buffering ( 8 buffers or more ).
I realize the surface returned by SDL_SetVideoMode() is a shadow software surface, which is copied to the real ( and hidden ) video surface when SDL_UpdateRect() is called. To make any of the N buffers visible, I must first copy the data to this shadow surface, followed by another copy to the video memory with SDL_UpdateRect(). This is very inefficient, copying every frame twice when only one copy should be required.
So, I would like to copy the data of any of the N buffers directly to video memory. Unfortunately, there seems to be no way to acquire the real video surface ( current_video->screen or SDL_VideoSurface ). Alternatively, I could change the SDL_VideoDevice’s shadow surface pointer ( current_video->shadow or SDL_ShadowSurface ) to any of the N buffers I desire to render visible, but all these symbols are not publicly exported.
Briefly, am I missing something or it’s impossible to perform N buffering with SDL? It seems to be a fairly arbitrary limitation, it could easily be done if one could just grab a pointer to the real video surface.