SDL_gpu  0.11.0
A hardware-accelerated, cross-platform 2D graphics API
Data Structures | Typedefs
Rendering

Data Structures

struct  GPU_Rect
 

Typedefs

typedef Uint32 GPU_BatchFlagEnum
 
DECLSPEC void SDLCALL GPU_Clear (GPU_Target *target)
 
DECLSPEC void SDLCALL GPU_ClearColor (GPU_Target *target, SDL_Color color)
 
DECLSPEC void SDLCALL GPU_ClearRGB (GPU_Target *target, Uint8 r, Uint8 g, Uint8 b)
 
DECLSPEC void SDLCALL GPU_ClearRGBA (GPU_Target *target, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 
DECLSPEC void SDLCALL GPU_Blit (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y)
 
DECLSPEC void SDLCALL GPU_BlitRotate (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float degrees)
 
DECLSPEC void SDLCALL GPU_BlitScale (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float scaleX, float scaleY)
 
DECLSPEC void SDLCALL GPU_BlitTransform (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float degrees, float scaleX, float scaleY)
 
DECLSPEC void SDLCALL GPU_BlitTransformX (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, float x, float y, float pivot_x, float pivot_y, float degrees, float scaleX, float scaleY)
 
DECLSPEC void SDLCALL GPU_BlitRect (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, GPU_Rect *dest_rect)
 
DECLSPEC void SDLCALL GPU_BlitRectX (GPU_Image *image, GPU_Rect *src_rect, GPU_Target *target, GPU_Rect *dest_rect, float degrees, float pivot_x, float pivot_y, GPU_FlipEnum flip_direction)
 
DECLSPEC void SDLCALL GPU_TriangleBatch (GPU_Image *image, GPU_Target *target, unsigned short num_vertices, float *values, unsigned int num_indices, unsigned short *indices, GPU_BatchFlagEnum flags)
 
DECLSPEC void SDLCALL GPU_TriangleBatchX (GPU_Image *image, GPU_Target *target, unsigned short num_vertices, void *values, unsigned int num_indices, unsigned short *indices, GPU_BatchFlagEnum flags)
 
DECLSPEC void SDLCALL GPU_FlushBlitBuffer (void)
 
DECLSPEC void SDLCALL GPU_Flip (GPU_Target *target)
 

Detailed Description

Typedef Documentation

◆ GPU_BatchFlagEnum

typedef Uint32 GPU_BatchFlagEnum

Bit flags for geometry batching.

See also
GPU_TriangleBatch()
GPU_TriangleBatchX()

Definition at line 485 of file SDL_gpu.h.

Function Documentation

◆ GPU_Blit()

DECLSPEC void SDLCALL GPU_Blit ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y 
)

Draws the given image to the given render target.

Parameters
src_rectThe region of the source image to use. Pass NULL for the entire image.
xDestination x-position
yDestination y-position

Definition at line 1333 of file SDL_gpu.c.

◆ GPU_BlitRect()

DECLSPEC void SDLCALL GPU_BlitRect ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
GPU_Rect dest_rect 
)

Draws the given image to the given render target, scaling it to fit the destination region.

Parameters
src_rectThe region of the source image to use. Pass NULL for the entire image.
dest_rectThe region of the destination target image to draw upon. Pass NULL for the entire target.

Definition at line 1414 of file SDL_gpu.c.

◆ GPU_BlitRectX()

DECLSPEC void SDLCALL GPU_BlitRectX ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
GPU_Rect dest_rect,
float  degrees,
float  pivot_x,
float  pivot_y,
GPU_FlipEnum  flip_direction 
)

Draws the given image to the given render target, scaling it to fit the destination region.

Parameters
src_rectThe region of the source image to use. Pass NULL for the entire image.
dest_rectThe region of the destination target image to draw upon. Pass NULL for the entire target.
degreesRotation angle (in degrees)
pivot_xPivot x-position (in image coordinates)
pivot_yPivot y-position (in image coordinates)
flip_directionA GPU_FlipEnum value (or bitwise OR'd combination) that specifies which direction the image should be flipped.

Definition at line 1436 of file SDL_gpu.c.

◆ GPU_BlitRotate()

DECLSPEC void SDLCALL GPU_BlitRotate ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y,
float  degrees 
)

Rotates and draws the given image to the given render target.

Parameters
src_rectThe region of the source image to use. Pass NULL for the entire image.
xDestination x-position
yDestination y-position
degreesRotation angle (in degrees)

Definition at line 1350 of file SDL_gpu.c.

◆ GPU_BlitScale()

DECLSPEC void SDLCALL GPU_BlitScale ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y,
float  scaleX,
float  scaleY 
)

Scales and draws the given image to the given render target.

Parameters
src_rectThe region of the source image to use. Pass NULL for the entire image.
xDestination x-position
yDestination y-position
scaleXHorizontal stretch factor
scaleYVertical stretch factor

Definition at line 1366 of file SDL_gpu.c.

◆ GPU_BlitTransform()

DECLSPEC void SDLCALL GPU_BlitTransform ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y,
float  degrees,
float  scaleX,
float  scaleY 
)

Scales, rotates, and draws the given image to the given render target.

Parameters
src_rectThe region of the source image to use. Pass NULL for the entire image.
xDestination x-position
yDestination y-position
degreesRotation angle (in degrees)
scaleXHorizontal stretch factor
scaleYVertical stretch factor

Definition at line 1382 of file SDL_gpu.c.

◆ GPU_BlitTransformX()

DECLSPEC void SDLCALL GPU_BlitTransformX ( GPU_Image image,
GPU_Rect src_rect,
GPU_Target target,
float  x,
float  y,
float  pivot_x,
float  pivot_y,
float  degrees,
float  scaleX,
float  scaleY 
)

Scales, rotates around a pivot point, and draws the given image to the given render target. The drawing point (x, y) coincides with the pivot point on the src image (pivot_x, pivot_y).

Parameters
src_rectThe region of the source image to use. Pass NULL for the entire image.
xDestination x-position
yDestination y-position
pivot_xPivot x-position (in image coordinates)
pivot_yPivot y-position (in image coordinates)
degreesRotation angle (in degrees)
scaleXHorizontal stretch factor
scaleYVertical stretch factor

Definition at line 1398 of file SDL_gpu.c.

◆ GPU_Clear()

DECLSPEC void SDLCALL GPU_Clear ( GPU_Target target)

Clears the contents of the given render target. Fills the target with color {0, 0, 0, 0}.

Definition at line 1992 of file SDL_gpu.c.

◆ GPU_ClearColor()

DECLSPEC void SDLCALL GPU_ClearColor ( GPU_Target target,
SDL_Color  color 
)

Fills the given render target with a color.

Definition at line 2003 of file SDL_gpu.c.

◆ GPU_ClearRGB()

DECLSPEC void SDLCALL GPU_ClearRGB ( GPU_Target target,
Uint8  r,
Uint8  g,
Uint8  b 
)

Fills the given render target with a color (alpha is 255, fully opaque).

Definition at line 2014 of file SDL_gpu.c.

◆ GPU_ClearRGBA()

DECLSPEC void SDLCALL GPU_ClearRGBA ( GPU_Target target,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Fills the given render target with a color.

Definition at line 2025 of file SDL_gpu.c.

◆ GPU_Flip()

DECLSPEC void SDLCALL GPU_Flip ( GPU_Target target)

Updates the given target's associated window. For non-context targets (e.g. image targets), this will flush the blit buffer.

Definition at line 2044 of file SDL_gpu.c.

◆ GPU_FlushBlitBuffer()

DECLSPEC void SDLCALL GPU_FlushBlitBuffer ( void  )

Send all buffered blitting data to the current context target.

Definition at line 2036 of file SDL_gpu.c.

◆ GPU_TriangleBatch()

DECLSPEC void SDLCALL GPU_TriangleBatch ( GPU_Image image,
GPU_Target target,
unsigned short  num_vertices,
float *  values,
unsigned int  num_indices,
unsigned short *  indices,
GPU_BatchFlagEnum  flags 
)

Renders triangles from the given set of vertices. This lets you render arbitrary 2D geometry. It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.

Parameters
valuesA tightly-packed array of vertex position (e.g. x,y), texture coordinates (e.g. s,t), and color (e.g. r,g,b,a) values. Texture coordinates and color values are expected to be already normalized to 0.0 - 1.0. Pass NULL to render with only custom shader attributes.
indicesIf not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array).
flagsBit flags to control the interpretation of the 'values' array parameters.

Definition at line 1491 of file SDL_gpu.c.

◆ GPU_TriangleBatchX()

DECLSPEC void SDLCALL GPU_TriangleBatchX ( GPU_Image image,
GPU_Target target,
unsigned short  num_vertices,
void *  values,
unsigned int  num_indices,
unsigned short *  indices,
GPU_BatchFlagEnum  flags 
)

Renders triangles from the given set of vertices. This lets you render arbitrary 2D geometry. It is a direct path to the GPU, so the format is different than typical SDL_gpu calls.

Parameters
valuesA tightly-packed array of vertex position (e.g. x,y), texture coordinates (e.g. s,t), and color (e.g. r,g,b,a) values. Texture coordinates and color values are expected to be already normalized to 0.0 - 1.0 (or 0 - 255 for 8-bit color components). Pass NULL to render with only custom shader attributes.
indicesIf not NULL, this is used to specify which vertices to use and in what order (i.e. it indexes the vertices in the 'values' array).
flagsBit flags to control the interpretation of the 'values' array parameters.

Definition at line 1496 of file SDL_gpu.c.