Surfaces manipulation
The basic surface manipulation usually consists of filling the part or whole surface with color, which can be in fact clearing the surface, and copying the surface content into another surface. As you already know, the surface can also represent the screen content. With these two groups of operations you can do almost anything.
Getting ready
In this recipe, you'll be working with routines that require a definition of a rectangular area over which the operation will occur. The libSDL library uses its own SDL_Rect
object to define such a rectangular area. You can create this object either with SDL.SDL_Rect_new
or SDL.SDL_Rect_local
. The second one is preferred because it contains an automatic garbage collection routine, so you don't have to explicitly call the SDL.SDL_Rect_delete
function to delete the object. The only downside of this is that you can't set the position nor the size of rectangle in the constructor. This means that you have to set all the...