Module d2d.sdl2.Surface

Surface

Functions

NameDescription
loadImage(imagePath) Uses the SDL_Image library to create a non-bmp image surface
scaled(original, desiredW, desiredH) Returns a surface that fits the given rectangle Fits the original surface within the returned surface to be as large as it can while maintaining aspect ratio Also centers the original surface within the returned surface

Classes

NameDescription
Surface Surfaces are a rectangular collection of pixels Surfaces are easy to work with and edit and can be blitted on to another surface Surfaces can also be converted to textures which are more efficient but less flexible Surfaces are handled in software as opposed to textures which are handled in hardware Surfaces can be used, but when used repeatedly and stored, textures should be preferred Surface draw methods do not respect alpha, but surface blitting does; to draw with alpha, draw to another surface, and blit to desired surface