SDL2_gfx  1.0.1
GraphicsprimitivesandsurfacefunctionsforSDL2
Defines | Functions
I:/Sources/sdl2gfx/SDL2_gfxPrimitives.h File Reference
#include <math.h>
#include "SDL.h"

Go to the source code of this file.

Defines

#define M_PI   3.1415926535897932384626433832795
#define SDL2_GFXPRIMITIVES_MAJOR   1
#define SDL2_GFXPRIMITIVES_MINOR   0
#define SDL2_GFXPRIMITIVES_MICRO   1
#define SDL2_GFXPRIMITIVES_SCOPE   extern

Functions

SDL2_GFXPRIMITIVES_SCOPE int pixelColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint32 color)
 Draw pixel with blending enabled if a<255.
SDL2_GFXPRIMITIVES_SCOPE int pixelRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw pixel with blending enabled if a<255.
SDL2_GFXPRIMITIVES_SCOPE int hlineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color)
 Draw horizontal line with blending.
SDL2_GFXPRIMITIVES_SCOPE int hlineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw horizontal line with blending.
SDL2_GFXPRIMITIVES_SCOPE int vlineColor (SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color)
 Draw vertical line with blending.
SDL2_GFXPRIMITIVES_SCOPE int vlineRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw vertical line with blending.
SDL2_GFXPRIMITIVES_SCOPE int rectangleColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw rectangle with blending.
SDL2_GFXPRIMITIVES_SCOPE int rectangleRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw rectangle with blending.
SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
 Draw rounded-corner rectangle with blending.
SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw rounded-corner rectangle with blending.
SDL2_GFXPRIMITIVES_SCOPE int boxColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw box (filled rectangle) with blending.
SDL2_GFXPRIMITIVES_SCOPE int boxRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw box (filled rectangle) with blending.
SDL2_GFXPRIMITIVES_SCOPE int roundedBoxColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
 Draw rounded-corner box (filled rectangle) with blending.
SDL2_GFXPRIMITIVES_SCOPE int roundedBoxRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw rounded-corner box (filled rectangle) with blending.
SDL2_GFXPRIMITIVES_SCOPE int lineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw line with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int lineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw line with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int aalineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
 Draw anti-aliased line with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int aalineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased line with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int thickLineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color)
 Draw a thick line with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int thickLineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a thick line with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int circleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
 Draw circle with blending.
SDL2_GFXPRIMITIVES_SCOPE int circleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw circle with blending.
SDL2_GFXPRIMITIVES_SCOPE int arcColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
 Arc with blending.
SDL2_GFXPRIMITIVES_SCOPE int arcRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Arc with blending.
SDL2_GFXPRIMITIVES_SCOPE int aacircleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
 Draw anti-aliased circle with blending.
SDL2_GFXPRIMITIVES_SCOPE int aacircleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased circle with blending.
SDL2_GFXPRIMITIVES_SCOPE int filledCircleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 r, Uint32 color)
 Draw filled circle with blending.
SDL2_GFXPRIMITIVES_SCOPE int filledCircleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled circle with blending.
SDL2_GFXPRIMITIVES_SCOPE int ellipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
 Draw ellipse with blending.
SDL2_GFXPRIMITIVES_SCOPE int ellipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw ellipse with blending.
SDL2_GFXPRIMITIVES_SCOPE int aaellipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
 Draw anti-aliased ellipse with blending.
SDL2_GFXPRIMITIVES_SCOPE int aaellipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased ellipse with blending.
SDL2_GFXPRIMITIVES_SCOPE int filledEllipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
 Draw filled ellipse with blending.
SDL2_GFXPRIMITIVES_SCOPE int filledEllipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled ellipse with blending.
SDL2_GFXPRIMITIVES_SCOPE int pieColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
 Draw pie (outline) with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int pieRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw pie (outline) with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int filledPieColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
 Draw filled pie with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int filledPieRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled pie with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int trigonColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
 Draw trigon (triangle outline) with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int trigonRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw trigon (triangle outline) with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int aatrigonColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
 Draw anti-aliased trigon (triangle outline) with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int aatrigonRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased trigon (triangle outline) with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int filledTrigonColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color)
 Draw filled trigon (triangle) with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int filledTrigonRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled trigon (triangle) with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int polygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
 Draw polygon with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int polygonRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw polygon with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int aapolygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
 Draw anti-aliased polygon with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int aapolygonRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw anti-aliased polygon with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int filledPolygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
 Draw filled polygon with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int filledPolygonRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw filled polygon with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int texturedPolygon (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, SDL_Surface *texture, int texture_dx, int texture_dy)
 Draws a polygon filled with the given texture.
SDL2_GFXPRIMITIVES_SCOPE int bezierColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint32 color)
 Draw a bezier curve with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE int bezierRGBA (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a bezier curve with alpha blending.
SDL2_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFont (const void *fontdata, Uint32 cw, Uint32 ch)
 Sets or resets the current global font data.
SDL2_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFontRotation (Uint32 rotation)
 Sets current global font character rotation steps.
SDL2_GFXPRIMITIVES_SCOPE int characterColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint32 color)
 Draw a character of the currently set font.
SDL2_GFXPRIMITIVES_SCOPE int characterRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a character of the currently set font.
SDL2_GFXPRIMITIVES_SCOPE int stringColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint32 color)
 Draw a string in the currently set font.
SDL2_GFXPRIMITIVES_SCOPE int stringRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
 Draw a string in the currently set font.

Define Documentation

#define M_PI   3.1415926535897932384626433832795

Definition at line 35 of file SDL2_gfxPrimitives.h.

#define SDL2_GFXPRIMITIVES_MAJOR   1

Definition at line 47 of file SDL2_gfxPrimitives.h.

#define SDL2_GFXPRIMITIVES_MICRO   1

Definition at line 49 of file SDL2_gfxPrimitives.h.

#define SDL2_GFXPRIMITIVES_MINOR   0

Definition at line 48 of file SDL2_gfxPrimitives.h.

#define SDL2_GFXPRIMITIVES_SCOPE   extern

Definition at line 64 of file SDL2_gfxPrimitives.h.


Function Documentation

SDL2_GFXPRIMITIVES_SCOPE int aacircleColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Uint32  color 
)

Draw anti-aliased circle with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the aa-circle.
yY coordinate of the center of the aa-circle.
radRadius in pixels of the aa-circle.
colorThe color value of the aa-circle to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1416 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int aacircleRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw anti-aliased circle with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the aa-circle.
yY coordinate of the center of the aa-circle.
radRadius in pixels of the aa-circle.
rThe red value of the aa-circle to draw.
gThe green value of the aa-circle to draw.
bThe blue value of the aa-circle to draw.
aThe alpha value of the aa-circle to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1436 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int aaellipseColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rx,
Sint16  ry,
Uint32  color 
)

Draw anti-aliased ellipse with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the aa-ellipse.
yY coordinate of the center of the aa-ellipse.
rxHorizontal radius in pixels of the aa-ellipse.
ryVertical radius in pixels of the aa-ellipse.
colorThe color value of the aa-ellipse to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1793 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int aaellipseRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rx,
Sint16  ry,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw anti-aliased ellipse with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the aa-ellipse.
yY coordinate of the center of the aa-ellipse.
rxHorizontal radius in pixels of the aa-ellipse.
ryVertical radius in pixels of the aa-ellipse.
rThe red value of the aa-ellipse to draw.
gThe green value of the aa-ellipse to draw.
bThe blue value of the aa-ellipse to draw.
aThe alpha value of the aa-ellipse to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1814 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int aalineColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Uint32  color 
)

Draw anti-aliased line with alpha blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-line.
y1Y coordinate of the first point of the aa-line.
x2X coordinate of the second point of the aa-line.
y2Y coordinate of the second point of the aa-line.
colorThe color value of the aa-line to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1081 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int aalineRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw anti-aliased line with alpha blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-line.
y1Y coordinate of the first point of the aa-line.
x2X coordinate of the second point of the aa-line.
y2Y coordinate of the second point of the aa-line.
rThe red value of the aa-line to draw.
gThe green value of the aa-line to draw.
bThe blue value of the aa-line to draw.
aThe alpha value of the aa-line to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1102 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int aapolygonColor ( SDL_Renderer *  renderer,
const Sint16 *  vx,
const Sint16 *  vy,
int  n,
Uint32  color 
)

Draw anti-aliased polygon with alpha blending.

Parameters:
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the aa-polygon.
vyVertex array containing Y coordinates of the points of the aa-polygon.
nNumber of points in the vertex array. Minimum number is 3.
colorThe color value of the aa-polygon to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2716 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int aapolygonRGBA ( SDL_Renderer *  renderer,
const Sint16 *  vx,
const Sint16 *  vy,
int  n,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw anti-aliased polygon with alpha blending.

Parameters:
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the aa-polygon.
vyVertex array containing Y coordinates of the points of the aa-polygon.
nNumber of points in the vertex array. Minimum number is 3.
rThe red value of the aa-polygon to draw.
gThe green value of the aa-polygon to draw.
bThe blue value of the aa-polygon to draw.
aThe alpha value of the aa-polygon to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2736 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int aatrigonColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Sint16  x3,
Sint16  y3,
Uint32  color 
)

Draw anti-aliased trigon (triangle outline) with alpha blending.

Note: Creates vertex array and uses aapolygon routine to render.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-trigon.
y1Y coordinate of the first point of the aa-trigon.
x2X coordinate of the second point of the aa-trigon.
y2Y coordinate of the second point of the aa-trigon.
x3X coordinate of the third point of the aa-trigon.
y3Y coordinate of the third point of the aa-trigon.
colorThe color value of the aa-trigon to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2444 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int aatrigonRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Sint16  x3,
Sint16  y3,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw anti-aliased trigon (triangle outline) with alpha blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the aa-trigon.
y1Y coordinate of the first point of the aa-trigon.
x2X coordinate of the second point of the aa-trigon.
y2Y coordinate of the second point of the aa-trigon.
x3X coordinate of the third point of the aa-trigon.
y3Y coordinate of the third point of the aa-trigon.
rThe red value of the aa-trigon to draw.
gThe green value of the aa-trigon to draw.
bThe blue value of the aa-trigon to draw.
aThe alpha value of the aa-trigon to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2476 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int arcColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Sint16  start,
Sint16  end,
Uint32  color 
)

Arc with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the arc.
yY coordinate of the center of the arc.
radRadius in pixels of the arc.
startStarting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
endEnding radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
colorThe color value of the arc to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1160 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int arcRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Sint16  start,
Sint16  end,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Arc with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the arc.
yY coordinate of the center of the arc.
radRadius in pixels of the arc.
startStarting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
endEnding radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
rThe red value of the arc to draw.
gThe green value of the arc to draw.
bThe blue value of the arc to draw.
aThe alpha value of the arc to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1183 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int bezierColor ( SDL_Renderer *  renderer,
const Sint16 *  vx,
const Sint16 *  vy,
int  n,
int  s,
Uint32  color 
)

Draw a bezier curve with alpha blending.

Parameters:
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the bezier curve.
vyVertex array containing Y coordinates of the points of the bezier curve.
nNumber of points in the vertex array. Minimum number is 3.
sNumber of steps for the interpolation. Minimum number is 2.
colorThe color value of the bezier curve to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 3729 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int bezierRGBA ( SDL_Renderer *  renderer,
const Sint16 *  vx,
const Sint16 *  vy,
int  n,
int  s,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw a bezier curve with alpha blending.

Parameters:
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the bezier curve.
vyVertex array containing Y coordinates of the points of the bezier curve.
nNumber of points in the vertex array. Minimum number is 3.
sNumber of steps for the interpolation. Minimum number is 2.
rThe red value of the bezier curve to draw.
gThe green value of the bezier curve to draw.
bThe blue value of the bezier curve to draw.
aThe alpha value of the bezier curve to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 3750 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int boxColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Uint32  color 
)

Draw box (filled rectangle) with blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
colorThe color value of the box to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 695 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int boxRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw box (filled rectangle) with blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
rThe red value of the box to draw.
gThe green value of the box to draw.
bThe blue value of the box to draw.
aThe alpha value of the box to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 716 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int characterColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
char  c,
Uint32  color 
)

Draw a character of the currently set font.

Parameters:
rendererThe renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the character.
yY (vertical) coordinate of the upper left corner of the character.
cThe character to draw.
colorThe color value of the character to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 3588 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int characterRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
char  c,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw a character of the currently set font.

Parameters:
rendererThe Renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the character.
yY (vertical) coordinate of the upper left corner of the character.
cThe character to draw.
rThe red value of the character to draw.
gThe green value of the character to draw.
bThe blue value of the character to draw.
aThe alpha value of the character to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 3466 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int circleColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Uint32  color 
)

Draw circle with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the circle.
yY coordinate of the center of the circle.
radRadius in pixels of the circle.
colorThe color value of the circle to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1120 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int circleRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw circle with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the circle.
yY coordinate of the center of the circle.
radRadius in pixels of the circle.
rThe red value of the circle to draw.
gThe green value of the circle to draw.
bThe blue value of the circle to draw.
aThe alpha value of the circle to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1140 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int ellipseColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rx,
Sint16  ry,
Uint32  color 
)

Draw ellipse with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the ellipse.
yY coordinate of the center of the ellipse.
rxHorizontal radius in pixels of the ellipse.
ryVertical radius in pixels of the ellipse.
colorThe color value of the ellipse to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1577 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int ellipseRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rx,
Sint16  ry,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw ellipse with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the ellipse.
yY coordinate of the center of the ellipse.
rxHorizontal radius in pixels of the ellipse.
ryVertical radius in pixels of the ellipse.
rThe red value of the ellipse to draw.
gThe green value of the ellipse to draw.
bThe blue value of the ellipse to draw.
aThe alpha value of the ellipse to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1598 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int filledCircleColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Uint32  color 
)

Draw filled circle with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the filled circle.
yY coordinate of the center of the filled circle.
radRadius in pixels of the filled circle.
colorThe color value of the filled circle to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1457 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int filledCircleRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw filled circle with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the filled circle.
yY coordinate of the center of the filled circle.
radRadius in pixels of the filled circle.
rThe red value of the filled circle to draw.
gThe green value of the filled circle to draw.
bThe blue value of the filled circle to draw.
aThe alpha value of the filled circle to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 1477 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int filledEllipseColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rx,
Sint16  ry,
Uint32  color 
)

Draw filled ellipse with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the filled ellipse.
yY coordinate of the center of the filled ellipse.
rxHorizontal radius in pixels of the filled ellipse.
ryVertical radius in pixels of the filled ellipse.
colorThe color value of the filled ellipse to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2007 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int filledEllipseRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rx,
Sint16  ry,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw filled ellipse with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the filled ellipse.
yY coordinate of the center of the filled ellipse.
rxHorizontal radius in pixels of the filled ellipse.
ryVertical radius in pixels of the filled ellipse.
rThe red value of the filled ellipse to draw.
gThe green value of the filled ellipse to draw.
bThe blue value of the filled ellipse to draw.
aThe alpha value of the filled ellipse to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2028 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int filledPieColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Sint16  start,
Sint16  end,
Uint32  color 
)

Draw filled pie with alpha blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the filled pie.
yY coordinate of the center of the filled pie.
radRadius in pixels of the filled pie.
startStarting radius in degrees of the filled pie.
endEnding radius in degrees of the filled pie.
colorThe color value of the filled pie to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2332 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int filledPieRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Sint16  start,
Sint16  end,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw filled pie with alpha blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the filled pie.
yY coordinate of the center of the filled pie.
radRadius in pixels of the filled pie.
startStarting radius in degrees of the filled pie.
endEnding radius in degrees of the filled pie.
rThe red value of the filled pie to draw.
gThe green value of the filled pie to draw.
bThe blue value of the filled pie to draw.
aThe alpha value of the filled pie to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2354 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int filledPolygonColor ( SDL_Renderer *  renderer,
const Sint16 *  vx,
const Sint16 *  vy,
int  n,
Uint32  color 
)

Draw filled polygon with alpha blending.

Parameters:
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the filled polygon.
vyVertex array containing Y coordinates of the points of the filled polygon.
nNumber of points in the vertex array. Minimum number is 3.
colorThe color value of the filled polygon to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2999 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int filledPolygonRGBA ( SDL_Renderer *  renderer,
const Sint16 *  vx,
const Sint16 *  vy,
int  n,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw filled polygon with alpha blending.

Parameters:
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the filled polygon.
vyVertex array containing Y coordinates of the points of the filled polygon.
nNumber of points in the vertex array. Minimum number is 3.
rThe red value of the filled polygon to draw.
gThe green value of the filled polygon to draw.
bThe blue value of the filed polygon to draw.
aThe alpha value of the filled polygon to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 3019 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int filledTrigonColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Sint16  x3,
Sint16  y3,
Uint32  color 
)

Draw filled trigon (triangle) with alpha blending.

Note: Creates vertex array and uses aapolygon routine to render.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the filled trigon.
y1Y coordinate of the first point of the filled trigon.
x2X coordinate of the second point of the filled trigon.
y2Y coordinate of the second point of the filled trigon.
x3X coordinate of the third point of the filled trigon.
y3Y coordinate of the third point of the filled trigon.
colorThe color value of the filled trigon to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2510 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int filledTrigonRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Sint16  x3,
Sint16  y3,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw filled trigon (triangle) with alpha blending.

Note: Creates vertex array and uses aapolygon routine to render.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the filled trigon.
y1Y coordinate of the first point of the filled trigon.
x2X coordinate of the second point of the filled trigon.
y2Y coordinate of the second point of the filled trigon.
x3X coordinate of the third point of the filled trigon.
y3Y coordinate of the third point of the filled trigon.
rThe red value of the filled trigon to draw.
gThe green value of the filled trigon to draw.
bThe blue value of the filled trigon to draw.
aThe alpha value of the filled trigon to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2544 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFont ( const void *  fontdata,
Uint32  cw,
Uint32  ch 
)

Sets or resets the current global font data.

The font data array is organized in follows: [fontdata] = [character 0][character 1]...[character 255] where [character n] = [byte 1 row 1][byte 2 row 1]...[byte {pitch} row 1][byte 1 row 2] ...[byte {pitch} row height] where [byte n] = [bit 0]...[bit 7] where [bit n] = [0 for transparent pixel|1 for colored pixel]

Parameters:
fontdataPointer to array of font data. Set to NULL, to reset global font to the default 8x8 font.
cwWidth of character in bytes. Ignored if fontdata==NULL.
chHeight of character in bytes. Ignored if fontdata==NULL.

Definition at line 3374 of file SDL2_gfxPrimitives.c.

Sets current global font character rotation steps.

Default is 0 (no rotation). 1 = 90deg clockwise. 2 = 180deg clockwise. 3 = 270deg clockwise. Changing the rotation, will reset the character cache.

Parameters:
rotationNumber of 90deg clockwise steps to rotate

Definition at line 3420 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int hlineColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  x2,
Sint16  y,
Uint32  color 
)

Draw horizontal line with blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. left) of the line.
x2X coordinate of the second point (i.e. right) of the line.
yY coordinate of the points of the line.
colorThe color value of the line to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 175 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int hlineRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  x2,
Sint16  y,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw horizontal line with blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. left) of the line.
x2X coordinate of the second point (i.e. right) of the line.
yY coordinate of the points of the line.
rThe red value of the line to draw.
gThe green value of the line to draw.
bThe blue value of the line to draw.
aThe alpha value of the line to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 195 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int lineColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Uint32  color 
)

Draw line with alpha blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the seond point of the line.
colorThe color value of the line to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 806 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int lineRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw line with alpha blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the second point of the line.
rThe red value of the line to draw.
gThe green value of the line to draw.
bThe blue value of the line to draw.
aThe alpha value of the line to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 827 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int pieColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Sint16  start,
Sint16  end,
Uint32  color 
)

Draw pie (outline) with alpha blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the pie.
yY coordinate of the center of the pie.
radRadius in pixels of the pie.
startStarting radius in degrees of the pie.
endEnding radius in degrees of the pie.
colorThe color value of the pie to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2290 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int pieRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Sint16  rad,
Sint16  start,
Sint16  end,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw pie (outline) with alpha blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the center of the pie.
yY coordinate of the center of the pie.
radRadius in pixels of the pie.
startStarting radius in degrees of the pie.
endEnding radius in degrees of the pie.
rThe red value of the pie to draw.
gThe green value of the pie to draw.
bThe blue value of the pie to draw.
aThe alpha value of the pie to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2313 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int pixelColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Uint32  color 
)

Draw pixel with blending enabled if a<255.

Parameters:
rendererThe renderer to draw on.
xX (horizontal) coordinate of the pixel.
yY (vertical) coordinate of the pixel.
colorThe color value of the pixel to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 88 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int pixelRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw pixel with blending enabled if a<255.

Parameters:
rendererThe renderer to draw on.
xX (horizontal) coordinate of the pixel.
yY (vertical) coordinate of the pixel.
rThe red color value of the pixel to draw.
gThe green color value of the pixel to draw.
bThe blue color value of the pixel to draw.
aThe alpha value of the pixel to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 107 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int polygonColor ( SDL_Renderer *  renderer,
const Sint16 *  vx,
const Sint16 *  vy,
int  n,
Uint32  color 
)

Draw polygon with alpha blending.

Parameters:
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the polygon.
vyVertex array containing Y coordinates of the points of the polygon.
nNumber of points in the vertex array. Minimum number is 3.
colorThe color value of the polygon to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2573 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int polygonRGBA ( SDL_Renderer *  renderer,
const Sint16 *  vx,
const Sint16 *  vy,
int  n,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw polygon with alpha blending.

Parameters:
rendererThe renderer to draw on.
vxVertex array containing X coordinates of the points of the polygon.
vyVertex array containing Y coordinates of the points of the polygon.
nNumber of points in the vertex array. Minimum number is 3.
rThe red value of the polygon to draw.
gThe green value of the polygon to draw.
bThe blue value of the polygon to draw.
aThe alpha value of the polygon to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2655 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int rectangleColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Uint32  color 
)

Draw rectangle with blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
colorThe color value of the rectangle to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 260 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int rectangleRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw rectangle with blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
rThe red value of the rectangle to draw.
gThe green value of the rectangle to draw.
bThe blue value of the rectangle to draw.
aThe alpha value of the rectangle to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 281 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int roundedBoxColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Sint16  rad,
Uint32  color 
)

Draw rounded-corner box (filled rectangle) with blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
radThe radius of the corner arcs of the box.
colorThe color value of the box to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 498 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int roundedBoxRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Sint16  rad,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw rounded-corner box (filled rectangle) with blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the box.
y1Y coordinate of the first point (i.e. top right) of the box.
x2X coordinate of the second point (i.e. bottom left) of the box.
y2Y coordinate of the second point (i.e. bottom left) of the box.
radThe radius of the corner arcs of the box.
rThe red value of the box to draw.
gThe green value of the box to draw.
bThe blue value of the box to draw.
aThe alpha value of the box to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 520 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Sint16  rad,
Uint32  color 
)

Draw rounded-corner rectangle with blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
radThe radius of the corner arc.
colorThe color value of the rectangle to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 353 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int roundedRectangleRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Sint16  rad,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw rounded-corner rectangle with blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point (i.e. top right) of the rectangle.
y1Y coordinate of the first point (i.e. top right) of the rectangle.
x2X coordinate of the second point (i.e. bottom left) of the rectangle.
y2Y coordinate of the second point (i.e. bottom left) of the rectangle.
radThe radius of the corner arc.
rThe red value of the rectangle to draw.
gThe green value of the rectangle to draw.
bThe blue value of the rectangle to draw.
aThe alpha value of the rectangle to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 375 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int stringColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
const char *  s,
Uint32  color 
)

Draw a string in the currently set font.

The spacing between consequtive characters in the string is the fixed number of pixels of the character width of the current global font.

Parameters:
rendererThe renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the string.
yY (vertical) coordinate of the upper left corner of the string.
sThe string to draw.
colorThe color value of the string to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 3609 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int stringRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y,
const char *  s,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw a string in the currently set font.

Parameters:
rendererThe renderer to draw on.
xX (horizontal) coordinate of the upper left corner of the string.
yY (vertical) coordinate of the upper left corner of the string.
sThe string to draw.
rThe red value of the string to draw.
gThe green value of the string to draw.
bThe blue value of the string to draw.
aThe alpha value of the string to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 3629 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int texturedPolygon ( SDL_Renderer *  renderer,
const Sint16 *  vx,
const Sint16 *  vy,
int  n,
SDL_Surface *  texture,
int  texture_dx,
int  texture_dy 
)

Draws a polygon filled with the given texture.

This standard version is calling multithreaded versions with NULL cache parameters.

Parameters:
rendererThe renderer to draw on.
vxarray of x vector components
vyarray of x vector components
nthe amount of vectors in the vx and vy array
texturethe sdl surface to use to fill the polygon
texture_dxthe offset of the texture relative to the screeen. if you move the polygon 10 pixels to the left and want the texture to apear the same you need to increase the texture_dx value
texture_dysee texture_dx
Returns:
Returns 0 on success, -1 on failure.

Definition at line 3306 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int thickLineColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Uint8  width,
Uint32  color 
)

Draw a thick line with alpha blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the second point of the line.
widthWidth of the line in pixels. Must be >0.
colorThe color value of the line to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 4301 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int thickLineRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Uint8  width,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw a thick line with alpha blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the line.
y1Y coordinate of the first point of the line.
x2X coordinate of the second point of the line.
y2Y coordinate of the second point of the line.
widthWidth of the line in pixels. Must be >0.
rThe red value of the character to draw.
gThe green value of the character to draw.
bThe blue value of the character to draw.
aThe alpha value of the character to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 4323 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int trigonColor ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Sint16  x3,
Sint16  y3,
Uint32  color 
)

Draw trigon (triangle outline) with alpha blending.

Note: Creates vertex array and uses polygon routine to render.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the trigon.
y1Y coordinate of the first point of the trigon.
x2X coordinate of the second point of the trigon.
y2Y coordinate of the second point of the trigon.
x3X coordinate of the third point of the trigon.
y3Y coordinate of the third point of the trigon.
colorThe color value of the trigon to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2378 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int trigonRGBA ( SDL_Renderer *  renderer,
Sint16  x1,
Sint16  y1,
Sint16  x2,
Sint16  y2,
Sint16  x3,
Sint16  y3,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw trigon (triangle outline) with alpha blending.

Parameters:
rendererThe renderer to draw on.
x1X coordinate of the first point of the trigon.
y1Y coordinate of the first point of the trigon.
x2X coordinate of the second point of the trigon.
y2Y coordinate of the second point of the trigon.
x3X coordinate of the third point of the trigon.
y3Y coordinate of the third point of the trigon.
rThe red value of the trigon to draw.
gThe green value of the trigon to draw.
bThe blue value of the trigon to draw.
aThe alpha value of the trigon to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 2410 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int vlineColor ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y1,
Sint16  y2,
Uint32  color 
)

Draw vertical line with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the points of the line.
y1Y coordinate of the first point (i.e. top) of the line.
y2Y coordinate of the second point (i.e. bottom) of the line.
colorThe color value of the line to draw (0xRRGGBBAA).
Returns:
Returns 0 on success, -1 on failure.

Definition at line 217 of file SDL2_gfxPrimitives.c.

SDL2_GFXPRIMITIVES_SCOPE int vlineRGBA ( SDL_Renderer *  renderer,
Sint16  x,
Sint16  y1,
Sint16  y2,
Uint8  r,
Uint8  g,
Uint8  b,
Uint8  a 
)

Draw vertical line with blending.

Parameters:
rendererThe renderer to draw on.
xX coordinate of the points of the line.
y1Y coordinate of the first point (i.e. top) of the line.
y2Y coordinate of the second point (i.e. bottom) of the line.
rThe red value of the line to draw.
gThe green value of the line to draw.
bThe blue value of the line to draw.
aThe alpha value of the line to draw.
Returns:
Returns 0 on success, -1 on failure.

Definition at line 237 of file SDL2_gfxPrimitives.c.