by mlepage » Sep 18, 2004 @ 11:00pm
Blt (block transfer) means copying data in memory, in this case, image data.
Image data is stored in surfaces. Think of the surface as memory containing the values for the pixels at each x/y of the surface.
So an image for a sprite might be in one surface. You blt that data (src) to a particular location of another surface (dest) to draw into the second surface.
In this case, the backbuffer is a special surface that represents the screen. Drawing to this surface does not draw onto the physical screen. Rather, once per frame, this backbuffer is copied (blt again) to the buffer which represents the physical screen.
Once you've drawn something to the backbuffer, it will stay there (repeatedly drawn to the physical screen every frame) until you change it (e.g. by erasing the backbuffer). One style is to redraw the entire backbuffer each frame, but there are other styles of handling this also.
A rect is just a math type storing numbers representing a rectangle.
To make sprites, which might have images, location, velocity, etc., you would build them using these tools. They aren't built into GapiDraw. However, you may find others have made libraries using GapiDraw that provide sprites.