[SDL] N buffering and access to the hidden video surface

Alexis Naveros alexis at rayforce.net
Thu Mar 1 14:57:20 PST 2007


Hi Ryan,

> How much overhead does the extra copy cause here?

The difference between having to copy 300mb or 600mb around per second is not negligible, plus the cost of receiving and decompressing all the data. Briefly, the cheaper operations are, the more frames can be pushed per second... so I would prefer to avoid any unnecessary waste.

> I don't think it would be something we'd add to SDL itself, but you 
> could probably wedge this in there fairly easily.

I think a function could exist to supply a different "shadow" surface for the "screen", replacing current_video->shadow, assuming it is of the same resolution and format. SDL_UpdateRect() could then be used to read from this new shadow suface and the previous one would become a regular independant surface.

Do you see any problem with such a feature? Should I understand that there wouldn't be interest in such a patch? ( or anything equivalent to provide similar functionality )

Thanks,
Alexis


More information about the SDL mailing list