Miscellaneous Functions
Primitives
Polygon
Transform
Surface
Drawing
Palette
Control
Misc
Defines
Extended

Arguments

Index
Credits

Return Name Arguments
Uint32SPG_MixAlphaSDL_Surface* surface, Uint32 color, Uint8 alpha
intSPG_Clampint value, int min, int max
floatSPG_sqrtfloat x
SDL_RectSPG_MakeRectSint16 x, Sint16 y, Uint16 w, Uint16 h
SDL_RectSPG_MakeRectRelativeSint16 x, Sint16 y, Sint16 x2, Sint16 y2
SPG_PointSPG_MakePointSint16 x, Sint16 y
SPG_boolSPG_RectANDconst SDL_Rect& A, const SDL_Rect& B, SDL_Rect* intersection
voidSPG_RectORconst SDL_Rect& rect1, const SDL_Rect& rect2, SDL_Rect& dst_rect


Uint32      SPG_MixAlpha(SDL_Surface *surface, Uint32 color, Uint8 alpha)
- Returns a color value with the alpha component overwritten by the given alpha.

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.


SPriG v0.94 Documentation by Jonathan Dearborn 2008