[SDL] Surface Blitting Cost
Ryan C. Gordon
icculus at icculus.org
Wed Oct 18 00:51:55 PDT 2006
> Reason I ask is, I am in am doing an app where several images have to be
> combined together, rotated, then finally placed onto the screen. I have sprite
> sheets of the items I have to splice, and will be using OpenGL to rotate the
> final image. So I'm wondering if its cheaper to load all of them into OpenGL as
> textures (each sprite, not the sheet entirely) or use SDL to pick pieces of the
> sheet out, blit them together, and then pass the blitted surface onto OpenGL as
> a texture (which means I'd have to create one every frame since the image is
> constantly changing) and only then rotate it.
OpenGL is going to be much, much faster in almost all cases, unless you
can't guarantee hardware acceleration will be available, or you have
hundreds of megabytes of sprites that are used all the time with no
discernable pattern.
Blitting is expensive, doubly so when you consider that you have access
to hardware-accelerated texture mapping as an alternative.
--ryan.
More information about the SDL
mailing list