
Posted:
Aug 21, 2003 @ 6:44am
by InexorableTash
Another approach:
Add CGapiSurface::PrepareOptimizedSurface() which creates an RLE-optimized version for super-fast Blt-ing. Call this during CreateSurfaces(), or any time you update the "sprite" - just not every frame!
This would create an RLE-compressed variant optimized for the current screen pitch - so the CGapiSurface surface would have the raw and the compressed version attached. Then you can still use PNGs (etc) to load arbitrary surfaces, but if you know you're just doing relatively simple blits you can get extra performance out at the expense of memory.
(Or maybe this function takes a CGapiCompressedSurface as a param, so you can throw away the original if necessary and, like Alpha surfaces, this one has special smarts associated with it.)

Posted:
Aug 21, 2003 @ 8:11am
by Johan
Thanks for all the replies!
As it is, I think there might be too many issues involved in supporting compressed surfaces.. Clipping as mentioned would not work - a showstopper for many uses... I think I'll put my thoughts on other stuff for a while..
InexorableTash: I have thought about this as well.. Supporting a "Compressed copy" would however mean that I would have to rewrite ALL blit loops in CGapiSurface.. CGapiCompressedSurface or similar might work though..
The reason I was asking on GetBuffer was that one could achieve quite some performance boost of using for example GDI on some devices - but that way images would be read only...

Posted:
Aug 21, 2003 @ 7:15pm
by Johan
StephC: Your engine impresses me more everytime I hear about it...

Really, you have done an incredible job with it...
(clipping, rotation
and scaling.. now that's something to write home about)