A Surface always contains red, green and blue data, along with an optional alpha channel.
Surfaces come in two primary configurations, the traditional 8-bits per channel represented by
Surfaces are a CPU-based image representation, and must be converted appropriately to be drawn using the GPU. For example,to be used with OpenGL, the
To manipulate individual pixels of a Surface, the
To allocate a Surface that is 640x480 and has an alpha channel, use:
Surface mySurface( 640, 480, true );
A Surface can be created from an image file using the result of loadImage():
Surface bitmap( loadImage( "image.jpg" ) );
The pixels of each row of a Surface are stored in contiguous memory, and the start of each row is offset from the previous by the stride (measured in bytes) returned by