| Miscellaneous Functions | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Primitives Polygon Transform Surface Drawing Dirty Rect Palette Control Misc Defines Types Extended Arguments Index Credits |
SDL_Surface* SPG_InitSDL(Uint16 w, Uint16 h, Uint8 bitsperpixel, Uint32 systemFlags, Uint32 screenFlags) - Returns the display surface after calling SDL_Init() and SDL_SetVideoMode(). If the surface is NULL, there has been an error. Uint8 SPG_GetRed(SDL_PixelFormat* format, Uint32 color) - Returns the red color component. Uint8 SPG_GetGreen(SDL_PixelFormat* format, Uint32 color) - Returns the green color component. Uint8 SPG_GetBlue(SDL_PixelFormat* format, Uint32 color) - Returns the blue color component. Uint8 SPG_GetAlpha(SDL_PixelFormat* format, Uint32 color) - Returns the alpha color component. Uint32 SPG_MixRed(SDL_PixelFormat* format, Uint32 color, Uint8 red) - Returns a color value with the red component overwritten by the given red. Uint32 SPG_MixGreen(SDL_PixelFormat* format, Uint32 color, Uint8 green) - Returns a color value with the green component overwritten by the given green. Uint32 SPG_MixBlue(SDL_PixelFormat* format, Uint32 color, Uint8 blue) - Returns a color value with the blue component overwritten by the given blue. Uint32 SPG_MixAlpha(SDL_Surface *surface, Uint32 color, Uint8 alpha) - Returns a color value with the alpha component overwritten by the given alpha. Uint32 SPG_ConvertColor(SDL_PixelFormat* srcfmt, Uint32 srccolor, SDL_PixelFormat* destfmt) - Takes a color in the source format, then returns it in the dest format. int SPG_Clamp(int value, int min, int max) - Returns the given value forced to be between min and max. float SPG_sqrt(float x) - Returns the approximate square root of the given value. This function performs much faster than the standard sqrt found in math.h, while giving reasonable precision for heavy real-time usage. SDL_Rect SPG_MakeRect(Sint16 x, Sint16 y, Uint16 w, Uint16 h) - Returns an SDL_Rect initialized with the given values. SDL_Rect SPG_MakeRectRelative(Sint16 x, Sint16 y, Sint16 x2, Sint16 y2) - Returns an SDL_Rect defined by the two given points. SPG_Point SPG_MakePoint(Sint16 x, Sint16 y) - Returns an SPG_Point object from the given coordinates. SPG_bool SPG_RectAND(const SDL_Rect& A, const SDL_Rect& B, SDL_Rect* intersection) - Returns true if the given rects intersect. In that case, the intersection rect is set to the intersection of the other two. void SPG_RectOR(const SDL_Rect& rect1, const SDL_Rect& rect2, SDL_Rect& dst_rect) - Takes three rects and fills out the third to be a rect that contains both of the others. |
|||||||||||||||||||||||||||||||||||||||||||||||||||