Control Functions
Primitives
Polygon
Transform
Surface
Drawing
Dirty Rect
Palette
Control
Misc
Defines
Types
Extended

Arguments

Index
Credits

Return Name Arguments
void SPG_EnableAutolock SPG_bool enable
SPG_bool SPG_GetAutolock none
voidSPG_EnableRadiansSPG_bool enable
SPG_boolSPG_GetRadiansnone
void SPG_PushBlend Uint8 state
Uint8 SPG_PopBlend none
Uint8 SPG_GetBlend none
voidSPG_PushThicknessUint16 pixels
Uint16SPG_PopThicknessnone
Uint16SPG_GetThicknessnone
void SPG_PushAA SPG_bool enable
SPG_bool SPG_PopAA none
SPG_bool SPG_GetAA none
void SPG_PushSurfaceAlpha SPG_bool enable
SPG_bool SPG_PopSurfaceAlpha none
SPG_bool SPG_GetSurfaceAlpha none
void SPG_EnableErrors SPG_bool enable
void SPG_Error const char* err
char* SPG_GetError none
Uint16 SPG_NumErrors none


void        SPG_Lock(SPG_bool enable)
- Sets the state of the automatic surface lock.  When enabled, many functions will automatically lock and unlock the surfaces they use when necessary.

SPG_bool       SPG_GetLock()
- Returns the current state of the automatic surface lock.

void        SPG_EnableRadians(SPG_bool enable)
- When enabled, all functions will expect angles measured in radians.  When disabled, they will accept angles in degrees.

SPG_bool       SPG_GetRadians()
- Returns whether or not Sprig functions are currently accepting radian angle measure.

void        SPG_PushBlend(Uint8 state)
- Pushes a new current alpha-blending state to the top of the blend stack.  This causes alpha-blending functions to behave according to the new state.
The available blitting modes are:
Name RGB Alpha Description
SPG_DEST_ALPHA Blend Dest Blends colors normally and keeps the destination per-pixel alpha.  This is the same as SDL_BlitSurface's blending.
SPG_SRC_ALPHA Blend Src Blends colors and copies the source alpha.
SPG_COMBINE_ALPHA Blend Blend Blends colors and blends the alpha.  This is "True" blending and lends well to some neat compositing effects.
SPG_COPY_NO_ALPHA Src Opaque Copies the source color, sets the dest alpha to opaque.
SPG_COPY_DEST_ALPHA Src Dest Copies the source color, keeps the dest alpha.
SPG_COPY_SRC_ALPHA Src Src Copies the source color and alpha.
SPG_COPY_COMBINE_ALPHA Src Blend Copies the source color and blends the alpha.
SPG_COPY_ALPHA_ONLY Dest Src Keeps the dest color, but copies the source alpha.
SPG_COMBINE_ALPHA_ONLY Dest Blend Keeps the dest color, but blends the alpha.
SPG_REPLACE_COLORKEY Src Src If the destination surface has the SDL_SRCCOLORKEY flag, this replaces the dest colorkey color in the image with the source color and alpha.  This is similar to palette-swapping, but can be used with gradients and other images.



Uint8         SPG_PopBlend()
- Pops the current alpha-blending state from the blend stack.  This state's value is returned while the previous state becomes current.

Uint8         SPG_GetBlend()
- Returns the current alpha-blending state.

void        SPG_PushThickness(Uint16 pixels)
- Pushes a new current thickness to the top of the thickness stack.  This causes line graphics to be drawn at the current thickness of pixels.

Uint16    SPG_PopThickness()
- Pops the current thickness from the thickness stack.  This state's value is returned while the previous state becomes current.

Uint16    SPG_GetThickness()
- Returns the current thickness in pixels.

void        SPG_PushAA(SPG_bool enable)
- Pushes a new current anti-aliasing state to the top of the AA stack.  When enabled, this causes certain functions to be drawn smoothly.

SPG_bool    SPG_PopAA()
- Pops the current anti-aliasing state from the AA stack.  This state's value is returned while the previous state becomes current.

SPG_bool    SPG_GetAA()
- Returns the current anti-aliasing state.

void        SPG_PushSurfaceAlpha(SPG_bool enable)
- Pushes a new current surface alpha mode to the top of the surface alpha stack.  When enabled, this causes SPG_Blit to combine per-surface alpha and per-pixel alpha.

SPG_bool        SPG_PopSurfaceAlpha()
- Pops the current surface alpha mode from the surface alpha stack.  This state's value is returned while the previous state becomes current.

SPG_bool        SPG_GetSurfaceAlpha()
- Returns the current surface alpha mode.

void        SPG_EnableErrors(SPG_bool enable)
- Enable the error messages from SPriG functions.  These are retreived by using SPG_GetError.

void        SPG_Error(const char* err)
- Pushes the given error message onto the error stack.

char*       SPG_GetError()
- Pops the most recent error message from the error stack.

Uint16      SPG_NumErrors()
- Returns the number of errors left on the error stack.


SPriG v1.0.0 Documentation by Jonathan Dearborn 2008