SDL_gpu
0.11.0
A hardware-accelerated, cross-platform 2D graphics API
|
Data Structures | |
struct | GPU_Camera |
struct | GPU_Target |
DECLSPEC GPU_Target *SDLCALL | GPU_CreateAliasTarget (GPU_Target *target) |
DECLSPEC GPU_Target *SDLCALL | GPU_LoadTarget (GPU_Image *image) |
DECLSPEC GPU_Target *SDLCALL | GPU_GetTarget (GPU_Image *image) |
DECLSPEC void SDLCALL | GPU_FreeTarget (GPU_Target *target) |
DECLSPEC void SDLCALL | GPU_SetVirtualResolution (GPU_Target *target, Uint16 w, Uint16 h) |
DECLSPEC void SDLCALL | GPU_GetVirtualResolution (GPU_Target *target, Uint16 *w, Uint16 *h) |
DECLSPEC void SDLCALL | GPU_GetVirtualCoords (GPU_Target *target, float *x, float *y, float displayX, float displayY) |
DECLSPEC void SDLCALL | GPU_UnsetVirtualResolution (GPU_Target *target) |
DECLSPEC GPU_Rect SDLCALL | GPU_MakeRect (float x, float y, float w, float h) |
DECLSPEC SDL_Color SDLCALL | GPU_MakeColor (Uint8 r, Uint8 g, Uint8 b, Uint8 a) |
DECLSPEC void SDLCALL | GPU_SetViewport (GPU_Target *target, GPU_Rect viewport) |
DECLSPEC void SDLCALL | GPU_UnsetViewport (GPU_Target *target) |
DECLSPEC GPU_Camera SDLCALL | GPU_GetDefaultCamera (void) |
DECLSPEC GPU_Camera SDLCALL | GPU_GetCamera (GPU_Target *target) |
DECLSPEC GPU_Camera SDLCALL | GPU_SetCamera (GPU_Target *target, GPU_Camera *cam) |
DECLSPEC void SDLCALL | GPU_EnableCamera (GPU_Target *target, GPU_bool use_camera) |
DECLSPEC GPU_bool SDLCALL | GPU_IsCameraEnabled (GPU_Target *target) |
DECLSPEC SDL_Color SDLCALL | GPU_GetPixel (GPU_Target *target, Sint16 x, Sint16 y) |
DECLSPEC GPU_Rect SDLCALL | GPU_SetClipRect (GPU_Target *target, GPU_Rect rect) |
DECLSPEC GPU_Rect SDLCALL | GPU_SetClip (GPU_Target *target, Sint16 x, Sint16 y, Uint16 w, Uint16 h) |
DECLSPEC void SDLCALL | GPU_UnsetClip (GPU_Target *target) |
DECLSPEC GPU_bool SDLCALL | GPU_IntersectRect (GPU_Rect A, GPU_Rect B, GPU_Rect *result) |
DECLSPEC GPU_bool SDLCALL | GPU_IntersectClipRect (GPU_Target *target, GPU_Rect B, GPU_Rect *result) |
DECLSPEC void SDLCALL | GPU_SetTargetColor (GPU_Target *target, SDL_Color color) |
DECLSPEC void SDLCALL | GPU_SetTargetRGB (GPU_Target *target, Uint8 r, Uint8 g, Uint8 b) |
DECLSPEC void SDLCALL | GPU_SetTargetRGBA (GPU_Target *target, Uint8 r, Uint8 g, Uint8 b, Uint8 a) |
DECLSPEC void SDLCALL | GPU_UnsetTargetColor (GPU_Target *target) |
DECLSPEC GPU_Target* SDLCALL GPU_CreateAliasTarget | ( | GPU_Target * | target | ) |
Creates a target that aliases the given target. Aliases can be used to store target settings (e.g. viewports) for easy switching. GPU_FreeTarget() frees the alias's memory, but does not affect the original.
DECLSPEC void SDLCALL GPU_EnableCamera | ( | GPU_Target * | target, |
GPU_bool | use_camera | ||
) |
DECLSPEC void SDLCALL GPU_FreeTarget | ( | GPU_Target * | target | ) |
DECLSPEC GPU_Camera SDLCALL GPU_GetCamera | ( | GPU_Target * | target | ) |
DECLSPEC GPU_Camera SDLCALL GPU_GetDefaultCamera | ( | void | ) |
DECLSPEC SDL_Color SDLCALL GPU_GetPixel | ( | GPU_Target * | target, |
Sint16 | x, | ||
Sint16 | y | ||
) |
DECLSPEC GPU_Target* SDLCALL GPU_GetTarget | ( | GPU_Image * | image | ) |
DECLSPEC void SDLCALL GPU_GetVirtualCoords | ( | GPU_Target * | target, |
float * | x, | ||
float * | y, | ||
float | displayX, | ||
float | displayY | ||
) |
Converts screen space coordinates (such as from mouse input) to logical drawing coordinates. This interacts with GPU_SetCoordinateMode() when the y-axis is flipped (screen space is assumed to be inverted: (0,0) in the upper-left corner).
DECLSPEC void SDLCALL GPU_GetVirtualResolution | ( | GPU_Target * | target, |
Uint16 * | w, | ||
Uint16 * | h | ||
) |
DECLSPEC GPU_bool SDLCALL GPU_IntersectClipRect | ( | GPU_Target * | target, |
GPU_Rect | B, | ||
GPU_Rect * | result | ||
) |
Returns GPU_TRUE if the given target's clip rect and the given B rect overlap, in which case it also fills the given result rect with the intersection. result
can be NULL if you don't need the intersection. If the target doesn't have a clip rect enabled, this uses the whole target area.
DECLSPEC GPU_bool SDLCALL GPU_IsCameraEnabled | ( | GPU_Target * | target | ) |
DECLSPEC GPU_Target* SDLCALL GPU_LoadTarget | ( | GPU_Image * | image | ) |
Creates a new render target from the given image. It can then be accessed from image->target. This increments the internal refcount of the target, so it should be matched with a GPU_FreeTarget().
DECLSPEC SDL_Color SDLCALL GPU_MakeColor | ( | Uint8 | r, |
Uint8 | g, | ||
Uint8 | b, | ||
Uint8 | a | ||
) |
DECLSPEC GPU_Rect SDLCALL GPU_MakeRect | ( | float | x, |
float | y, | ||
float | w, | ||
float | h | ||
) |
DECLSPEC GPU_Camera SDLCALL GPU_SetCamera | ( | GPU_Target * | target, |
GPU_Camera * | cam | ||
) |
DECLSPEC GPU_Rect SDLCALL GPU_SetClip | ( | GPU_Target * | target, |
Sint16 | x, | ||
Sint16 | y, | ||
Uint16 | w, | ||
Uint16 | h | ||
) |
DECLSPEC GPU_Rect SDLCALL GPU_SetClipRect | ( | GPU_Target * | target, |
GPU_Rect | rect | ||
) |
DECLSPEC void SDLCALL GPU_SetTargetColor | ( | GPU_Target * | target, |
SDL_Color | color | ||
) |
Sets the modulation color for subsequent drawing of images and shapes on the given target. This has a cumulative effect with the image coloring functions. e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128); Would make the image draw with color of roughly (128, 64, 0).
DECLSPEC void SDLCALL GPU_SetTargetRGB | ( | GPU_Target * | target, |
Uint8 | r, | ||
Uint8 | g, | ||
Uint8 | b | ||
) |
Sets the modulation color for subsequent drawing of images and shapes on the given target. This has a cumulative effect with the image coloring functions. e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128); Would make the image draw with color of roughly (128, 64, 0).
DECLSPEC void SDLCALL GPU_SetTargetRGBA | ( | GPU_Target * | target, |
Uint8 | r, | ||
Uint8 | g, | ||
Uint8 | b, | ||
Uint8 | a | ||
) |
Sets the modulation color for subsequent drawing of images and shapes on the given target. This has a cumulative effect with the image coloring functions. e.g. GPU_SetRGB(image, 255, 128, 0); GPU_SetTargetRGB(target, 128, 128, 128); Would make the image draw with color of roughly (128, 64, 0).
DECLSPEC void SDLCALL GPU_SetViewport | ( | GPU_Target * | target, |
GPU_Rect | viewport | ||
) |
DECLSPEC void SDLCALL GPU_SetVirtualResolution | ( | GPU_Target * | target, |
Uint16 | w, | ||
Uint16 | h | ||
) |
DECLSPEC void SDLCALL GPU_UnsetClip | ( | GPU_Target * | target | ) |
DECLSPEC void SDLCALL GPU_UnsetTargetColor | ( | GPU_Target * | target | ) |
DECLSPEC void SDLCALL GPU_UnsetViewport | ( | GPU_Target * | target | ) |
DECLSPEC void SDLCALL GPU_UnsetVirtualResolution | ( | GPU_Target * | target | ) |