🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

SDL_BlitSurface vs mine

Started by
1 comment, last by Kylotan 19 years, 10 months ago
Hello! i use SDL to be able to display graphics, with pixel access. i like to reinvent the wheel, and thusly i think i will make my own sprite format and class structure and make a blitting function of my own. my question is now, how much performance will i lose? i'm not very good at superoptimizing stuff, and dont want to resort to asm for the crossplatformability. your ideas? edit: oh silly me, it turn out that about nine months ago i asked almost exactly the same question. i actually had no idea until i read my profile. not intentional at all. feel free to kick me, ban me, probate me, delete this thread or whatever you want. however, to keep it constructive, those few answers to the other post was not what i was looking for. the main point is that, using a SW_SURFACE, keeping it very 2d (meaning directdrawwrapping in winxp i suppose), would there be a major performance loss in doing all graphics pixel by pixel with my own functions. this naturally depends on how i've written my plotting functions. i was recommended in the other thread to plot to a surface, and blit that. would that not be slower, or am i misunderstanding everything wrong?
Advertisement
it would be very slow to do this pixel by pixel. especially with large surface.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
Given that the existing SDL_BlitSurface routines have been heavily optimised to use assembly on various platforms, and MMX in some cases if I'm not mistaken, I expect that your implementation would be significantly slower. I'd only recommend doing this if you're more interested in learning about it, as I doubt you'll end up with anything efficient in the short term.

This topic is closed to new replies.

Advertisement