In the SDL wiki it says
Use this function to perform a fast blit from the source surface to the destination surface.
However that doesn't help me much.
What does the term surface blitting mean in this context?
To "blit" is to copy bits from one part of a computer's graphical memory to another part. This technique deals directly with the pixels of an image, and draws them directly to the screen, which makes it a very fast rendering technique that's often perfect for fast-paced 2D action games.
The method . blit() — blit stands for Block Transfer—and it's going to copy the contents of one Surface onto another Surface .
An SDL surface is just an image data type that contains the pixels of an image along with all data needed to render it. SDL surfaces use software rendering which means it uses the CPU to render. It is possible to render hardware images but it's a bit more difficult so we're going to learn it the easy way first.
As mentioned in the last lesson, textures are the GPU rendering equivalent of surfaces. Hence, textures are almost always created from surfaces, using the function SDL_CreateTextureFromSurface().
Basically it means copying the image from one surface to another -- possibly cropped and shifted.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With