SDL_gfx: SDL_gfxPrimitives.h File Reference

# SDL_gfxPrimitives.h File Reference

`#include <math.h>`
`#include "SDL.h"`

Go to the source code of this file.

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

Definition at line 26 of file SDL_gfxPrimitives.h.

#define SDL_GFXPRIMITIVES_MICRO 22

Definition at line 28 of file SDL_gfxPrimitives.h.

#define SDL_GFXPRIMITIVES_MINOR 0

Definition at line 27 of file SDL_gfxPrimitives.h.

## Function Documentation

SDL_GFXPRIMITIVES_SCOPE int aacircleColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Uint32 | color |
| ) |  |  |

Draw anti-aliased circle with blending.

Note: The AA-circle routine is based on AA-ellipse with identical radii.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the aa-circle.
  | y | Y coordinate of the center of the aa-circle.
  | rad | Radius in pixels of the aa-circle.
  | color | The color value of the aa-circle to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 3446 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int aacircleRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw anti-aliased circle with blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the aa-circle.
  | y | Y coordinate of the center of the aa-circle.
  | rad | Radius in pixels of the aa-circle.
  | r | The red value of the aa-circle to draw.
  | g | The green value of the aa-circle to draw.
  | b | The blue value of the aa-circle to draw.
  | a | The alpha value of the aa-circle to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 3465 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int aaellipseColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rx,
|  | Sint16 | ry,
|  | Uint32 | color |
| ) |  |  |

Draw anti-aliased ellipse with blending.

Note: Based on code from Anders Lindstroem, which is based on code from sge library, which is based on code from TwinLib.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the aa-ellipse.
  | y | Y coordinate of the center of the aa-ellipse.
  | rx | Horizontal radius in pixels of the aa-ellipse.
  | ry | Vertical radius in pixels of the aa-ellipse.
  | color | The color value of the aa-ellipse to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4008 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int aaellipseRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rx,
|  | Sint16 | ry,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw anti-aliased ellipse with blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the aa-ellipse.
  | y | Y coordinate of the center of the aa-ellipse.
  | rx | Horizontal radius in pixels of the aa-ellipse.
  | ry | Vertical radius in pixels of the aa-ellipse.
  | r | The red value of the aa-ellipse to draw.
  | g | The green value of the aa-ellipse to draw.
  | b | The blue value of the aa-ellipse to draw.
  | a | The alpha value of the aa-ellipse to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4248 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int aalineColor | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Uint32 | color |
| ) |  |  |

Ddraw anti-aliased line with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the aa-line.
  | y1 | Y coordinate of the first point of the aa-line.
  | x2 | X coordinate of the second point of the aa-line.
  | y2 | Y coordinate of the second point of the aa-line.
  | color | The color value of the aa-line to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 2760 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int aalineRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw anti-aliased line with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the aa-line.
  | y1 | Y coordinate of the first point of the aa-line.
  | x2 | X coordinate of the second point of the aa-line.
  | y2 | Y coordinate of the second point of the aa-line.
  | r | The red value of the aa-line to draw.
  | g | The green value of the aa-line to draw.
  | b | The blue value of the aa-line to draw.
  | a | The alpha value of the aa-line to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 2780 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int aapolygonColor | ( | SDL_Surface * | dst,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n,
|  | Uint32 | color |
| ) |  |  |

Draw anti-aliased polygon with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | vx | Vertex array containing X coordinates of the points of the aa-polygon.
  | vy | Vertex array containing Y coordinates of the points of the aa-polygon.
  | n | Number of points in the vertex array. Minimum number is 3.
  | color | The color value of the aa-polygon to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4997 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int aapolygonRGBA | ( | SDL_Surface * | dst,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw anti-aliased polygon with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | vx | Vertex array containing X coordinates of the points of the aa-polygon.
  | vy | Vertex array containing Y coordinates of the points of the aa-polygon.
  | n | Number of points in the vertex array. Minimum number is 3.
  | r | The red value of the aa-polygon to draw.
  | g | The green value of the aa-polygon to draw.
  | b | The blue value of the aa-polygon to draw.
  | a | The alpha value of the aa-polygon to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 5065 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int aatrigonColor | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the aa-trigon.
  | y1 | Y coordinate of the first point of the aa-trigon.
  | x2 | X coordinate of the second point of the aa-trigon.
  | y2 | Y coordinate of the second point of the aa-trigon.
  | x3 | X coordinate of the third point of the aa-trigon.
  | y3 | Y coordinate of the third point of the aa-trigon.
  | color | The color value of the aa-trigon to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4779 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int aatrigonRGBA | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the aa-trigon.
  | y1 | Y coordinate of the first point of the aa-trigon.
  | x2 | X coordinate of the second point of the aa-trigon.
  | y2 | Y coordinate of the second point of the aa-trigon.
  | x3 | X coordinate of the third point of the aa-trigon.
  | y3 | Y coordinate of the third point of the aa-trigon.
  | r | The red value of the aa-trigon to draw.
  | g | The green value of the aa-trigon to draw.
  | b | The blue value of the aa-trigon to draw.
  | a | The alpha value of the aa-trigon to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4811 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int arcColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Sint16 | start,
|  | Sint16 | end,
|  | Uint32 | color |
| ) |  |  |

Arc with blending.

Note Arc drawing is based on circle algorithm by A. Schiffler and written by D. Raber. Calculates which octants arc goes through and renders pixels accordingly.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the arc.
  | y | Y coordinate of the center of the arc.
  | rad | Radius in pixels of the arc.
  | start | Starting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
  | end | Ending radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
  | color | The color value of the arc to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 3051 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int arcRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Sint16 | start,
|  | Sint16 | end,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Arc with blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the arc.
  | y | Y coordinate of the center of the arc.
  | rad | Radius in pixels of the arc.
  | start | Starting radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
  | end | Ending radius in degrees of the arc. 0 degrees is down, increasing counterclockwise.
  | r | The red value of the arc to draw.
  | g | The green value of the arc to draw.
  | b | The blue value of the arc to draw.
  | a | The alpha value of the arc to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 3422 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int bezierColor | ( | SDL_Surface * | dst,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n,
|  | int | s,
|  | Uint32 | color |
| ) |  |  |

Draw a bezier curve with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | vx | Vertex array containing X coordinates of the points of the bezier curve.
  | vy | Vertex array containing Y coordinates of the points of the bezier curve.
  | n | Number of points in the vertex array. Minimum number is 3.
  | s | Number of steps for the interpolation. Minimum number is 2.
  | color | The color value of the bezier curve to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 6131 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int bezierRGBA | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | vx | Vertex array containing X coordinates of the points of the bezier curve.
  | vy | Vertex array containing Y coordinates of the points of the bezier curve.
  | n | Number of points in the vertex array. Minimum number is 3.
  | s | Number of steps for the interpolation. Minimum number is 2.
  | r | The red value of the bezier curve to draw.
  | g | The green value of the bezier curve to draw.
  | b | The blue value of the bezier curve to draw.
  | a | The alpha value of the bezier curve to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 6206 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int boxColor | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Uint32 | color |
| ) |  |  |

Draw box (filled rectangle) with blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point (i.e. top right) of the box.
  | y1 | Y coordinate of the first point (i.e. top right) of the box.
  | x2 | X coordinate of the second point (i.e. bottom left) of the box.
  | y2 | Y coordinate of the second point (i.e. bottom left) of the box.
  | color | The color value of the box to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 2039 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int boxRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw box (filled rectangle) with blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point (i.e. top right) of the box.
  | y1 | Y coordinate of the first point (i.e. top right) of the box.
  | x2 | X coordinate of the second point (i.e. bottom left) of the box.
  | y2 | Y coordinate of the second point (i.e. bottom left) of the box.
  | r | The red value of the box to draw.
  | g | The green value of the box to draw.
  | b | The blue value of the box to draw.
  | a | The alpha value of the box to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 2251 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int characterColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | char | c,
|  | Uint32 | color |
| ) |  |  |

Draw a character of the currently set font.

On first call for a particular character and color combination, the function needs to generate the character surface (slower. Subsequent calls blit a cached surface (fast). Uses alpha blending if A<255 in color.

Parameters:

  | dst | The surface to draw on.
  | x | X (horizontal) coordinate of the upper left corner of the character.
  | y | Y (vertical) coordinate of the upper left corner of the character.
  | c | The character to draw.
  | color | The color value of the character to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 5818 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int characterRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | char | c,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw a character of the currently set font.

Parameters:

  | dst | The surface to draw on.
  | x | X (horizontal) coordinate of the upper left corner of the character.
  | y | Y (vertical) coordinate of the upper left corner of the character.
  | c | The character to draw.
  | r | The red value of the character to draw.
  | g | The green value of the character to draw.
  | b | The blue value of the character to draw.
  | a | The alpha value of the character to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 5987 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int circleColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Uint32 | color |
| ) |  |  |

Draw circle with blending.

Note: Circle drawing routine is based on an algorithms from the sge library, but modified by A. Schiffler for multiple pixel-draw removal and other minor speedup changes.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the circle.
  | y | Y coordinate of the center of the circle.
  | rad | Radius in pixels of the circle.
  | color | The color value of the circle to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 2804 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int circleRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw circle with blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the circle.
  | y | Y coordinate of the center of the circle.
  | rad | Radius in pixels of the circle.
  | r | The red value of the circle to draw.
  | g | The green value of the circle to draw.
  | b | The blue value of the circle to draw.
  | a | The alpha value of the circle to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 3024 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int ellipseColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rx,
|  | Sint16 | ry,
|  | Uint32 | color |
| ) |  |  |

Draw ellipse with blending.

Note: Based on algorithms from sge library with modifications by A. Schiffler for multiple-pixel draw removal and other minor speedup changes.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the ellipse.
  | y | Y coordinate of the center of the ellipse.
  | rx | Horizontal radius in pixels of the ellipse.
  | ry | Vertical radius in pixels of the ellipse.
  | color | The color value of the ellipse to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 3643 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int ellipseRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rx,
|  | Sint16 | ry,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw ellipse with blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the ellipse.
  | y | Y coordinate of the center of the ellipse.
  | rx | Horizontal radius in pixels of the ellipse.
  | ry | Vertical radius in pixels of the ellipse.
  | r | The red value of the ellipse to draw.
  | g | The green value of the ellipse to draw.
  | b | The blue value of the ellipse to draw.
  | a | The alpha value of the ellipse to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 3957 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledCircleColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Uint32 | color |
| ) |  |  |

Draw filled circle with blending.

Note: Based on algorithms from sge library with modifications by A. Schiffler for multiple-hline draw removal and other minor speedup changes.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the filled circle.
  | y | Y coordinate of the center of the filled circle.
  | rad | Radius in pixels of the filled circle.
  | color | The color value of the filled circle to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 3490 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledCircleRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw filled circle with blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the filled circle.
  | y | Y coordinate of the center of the filled circle.
  | rad | Radius in pixels of the filled circle.
  | r | The red value of the filled circle to draw.
  | g | The green value of the filled circle to draw.
  | b | The blue value of the filled circle to draw.
  | a | The alpha value of the filled circle to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 3617 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledEllipseColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rx,
|  | Sint16 | ry,
|  | Uint32 | color |
| ) |  |  |

Draw filled ellipse with blending.

Note: Based on algorithm from sge library with multiple-hline draw removal and other speedup changes.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the filled ellipse.
  | y | Y coordinate of the center of the filled ellipse.
  | rx | Horizontal radius in pixels of the filled ellipse.
  | ry | Vertical radius in pixels of the filled ellipse.
  | color | The color value of the filled ellipse to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4278 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledEllipseRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rx,
|  | Sint16 | ry,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw filled ellipse with blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the filled ellipse.
  | y | Y coordinate of the center of the filled ellipse.
  | rx | Horizontal radius in pixels of the filled ellipse.
  | ry | Vertical radius in pixels of the filled ellipse.
  | r | The red value of the filled ellipse to draw.
  | g | The green value of the filled ellipse to draw.
  | b | The blue value of the filled ellipse to draw.
  | a | The alpha value of the filled ellipse to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4446 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledPieColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Sint16 | start,
|  | Sint16 | end,
|  | Uint32 | color |
| ) |  |  |

Draw filled pie with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the filled pie.
  | y | Y coordinate of the center of the filled pie.
  | rad | Radius in pixels of the filled pie.
  | start | Starting radius in degrees of the filled pie.
  | end | Ending radius in degrees of the filled pie.
  | color | The color value of the filled pie to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4667 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledPieRGBA | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the filled pie.
  | y | Y coordinate of the center of the filled pie.
  | rad | Radius in pixels of the filled pie.
  | start | Starting radius in degrees of the filled pie.
  | end | Ending radius in degrees of the filled pie.
  | r | The red value of the filled pie to draw.
  | g | The green value of the filled pie to draw.
  | b | The blue value of the filled pie to draw.
  | a | The alpha value of the filled pie to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4688 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledPolygonColor | ( | SDL_Surface * | dst,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n,
|  | Uint32 | color |
| ) |  |  |

Draw filled polygon with alpha blending.

Note: Standard filledPolygon function is calling multithreaded version with NULL parameters to use the global vertex cache.

Parameters:

  | dst | The surface to draw on.
  | vx | Vertex array containing X coordinates of the points of the filled polygon.
  | vy | Vertex array containing Y coordinates of the points of the filled polygon.
  | n | Number of points in the vertex array. Minimum number is 3.
  | color | The color value of the filled polygon to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 5304 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledPolygonColorMT | ( | SDL_Surface * | dst,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n,
|  | Uint32 | color,
|  | int ** | polyInts,
|  | int * | polyAllocated |
| ) |  |  |

Draw filled polygon with alpha blending (multi-threaded capable).

Note: The last two parameters are optional; but are required for multithreaded operation.

Parameters:

  | dst | The surface to draw on.
  | vx | Vertex array containing X coordinates of the points of the filled polygon.
  | vy | Vertex array containing Y coordinates of the points of the filled polygon.
  | n | Number of points in the vertex array. Minimum number is 3.
  | color | The color value of the filled polygon to draw (0xRRGGBBAA).
  | polyInts | Preallocated, temporary vertex array used for sorting vertices. Required for multithreaded operation; set to NULL otherwise.
  | polyAllocated | Flag indicating if temporary vertex array was allocated. Required for multithreaded operation; set to NULL otherwise.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 5117 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledPolygonRGBA | ( | SDL_Surface * | dst,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw filled polygon with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | vx | Vertex array containing X coordinates of the points of the filled polygon.
  | vy | Vertex array containing Y coordinates of the points of the filled polygon.
  | n | Number of points in the vertex array. Minimum number is 3.
  | r | The red value of the filled polygon to draw.
  | g | The green value of the filled polygon to draw.
  | b | The blue value of the filed polygon to draw.
  | a | The alpha value of the filled polygon to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 5326 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledPolygonRGBAMT | ( | SDL_Surface * | dst,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a,
|  | int ** | polyInts,
|  | int * | polyAllocated |
| ) |  |  |

Draw filled polygon with alpha blending (multi-threaded capable).

Note: The last two parameters are optional; but are required for multithreaded operation.

Parameters:

  | dst | The surface to draw on.
  | vx | Vertex array containing X coordinates of the points of the filled polygon.
  | vy | Vertex array containing Y coordinates of the points of the filled polygon.
  | n | Number of points in the vertex array. Minimum number is 3.
  | r | The red value of the filled polygon to draw.
  | g | The green value of the filled polygon to draw.
  | b | The blue value of the filed polygon to draw.
  | a | The alpha value of the filled polygon to draw.
  | polyInts | Preallocated, temporary vertex array used for sorting vertices. Required for multithreaded operation; set to NULL otherwise.
  | polyAllocated | Flag indicating if temporary vertex array was allocated. Required for multithreaded operation; set to NULL otherwise.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 5282 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledTrigonColor | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the filled trigon.
  | y1 | Y coordinate of the first point of the filled trigon.
  | x2 | X coordinate of the second point of the filled trigon.
  | y2 | Y coordinate of the second point of the filled trigon.
  | x3 | X coordinate of the third point of the filled trigon.
  | y3 | Y coordinate of the third point of the filled trigon.
  | color | The color value of the filled trigon to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4845 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int filledTrigonRGBA | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the filled trigon.
  | y1 | Y coordinate of the first point of the filled trigon.
  | x2 | X coordinate of the second point of the filled trigon.
  | y2 | Y coordinate of the second point of the filled trigon.
  | x3 | X coordinate of the third point of the filled trigon.
  | y3 | Y coordinate of the third point of the filled trigon.
  | r | The red value of the filled trigon to draw.
  | g | The green value of the filled trigon to draw.
  | b | The blue value of the filled trigon to draw.
  | a | The alpha value of the filled trigon to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4879 of file SDL_gfxPrimitives.c.

SDL_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:

  | fontdata | Pointer to array of font data. Set to NULL, to reset global font to the default 8x8 font.
  | cw | Width of character in bytes. Ignored if fontdata==NULL.
  | ch | Height of character in bytes. Ignored if fontdata==NULL.

Definition at line 5725 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE void gfxPrimitivesSetFontRotation | ( | Uint32 | rotation | ) |

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:

  | rotation | Number of 90deg clockwise steps to rotate

Definition at line 5771 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int hlineColor | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | x2,
|  | Sint16 | y,
|  | Uint32 | color |
| ) |  |  |

Draw horizontal line with blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point (i.e. left) of the line.
  | x2 | X coordinate of the second point (i.e. right) of the line.
  | y | Y coordinate of the points of the line.
  | color | The color value of the line to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 1136 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int hlineRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | x2,
|  | Sint16 | y,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw horizontal line with blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point (i.e. left) of the line.
  | x2 | X coordinate of the second point (i.e. right) of the line.
  | y | Y coordinate of the points of the line.
  | r | The red value of the line to draw.
  | g | The green value of the line to draw.
  | b | The blue value of the line to draw.
  | a | The alpha value of the line to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 1305 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int lineColor | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Uint32 | color |
| ) |  |  |

Draw line with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the line.
  | y1 | Y coordinate of the first point of the line.
  | x2 | X coordinate of the second point of the line.
  | y2 | Y coordinate of the second point of the line.
  | color | The color value of the line to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 2279 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int lineRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw line with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the line.
  | y1 | Y coordinate of the first point of the line.
  | x2 | X coordinate of the second point of the line.
  | y2 | Y coordinate of the second point of the line.
  | r | The red value of the line to draw.
  | g | The green value of the line to draw.
  | b | The blue value of the line to draw.
  | a | The alpha value of the line to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 2488 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int pieColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Sint16 | start,
|  | Sint16 | end,
|  | Uint32 | color |
| ) |  |  |

Draw pie (outline) with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the pie.
  | y | Y coordinate of the center of the pie.
  | rad | Radius in pixels of the pie.
  | start | Starting radius in degrees of the pie.
  | end | Ending radius in degrees of the pie.
  | color | The color value of the pie to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4623 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int pieRGBA | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x | X coordinate of the center of the pie.
  | y | Y coordinate of the center of the pie.
  | rad | Radius in pixels of the pie.
  | start | Starting radius in degrees of the pie.
  | end | Ending radius in degrees of the pie.
  | r | The red value of the pie to draw.
  | g | The green value of the pie to draw.
  | b | The blue value of the pie to draw.
  | a | The alpha value of the pie to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4646 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int pixelColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Uint32 | color |
| ) |  |  |

Pixel draw with blending enabled if a<255.

Parameters:

  | dst | The surface to draw on.
  | x | X (horizontal) coordinate of the pixel.
  | y | Y (vertical) coordinate of the pixel.
  | color | The color value of the pixel to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 473 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int pixelRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Pixel draw with blending enabled if a<255.

Parameters:

  | dst | The surface to draw on.
  | x | X (horizontal) coordinate of the pixel.
  | y | Y (vertical) coordinate of the pixel.
  | r | The red color value of the pixel to draw.
  | g | The green color value of the pixel to draw.
  | b | The blue color value of the pixel to draw.
  | a | The alpha value of the pixel to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 927 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int polygonColor | ( | SDL_Surface * | dst,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n,
|  | Uint32 | color |
| ) |  |  |

Draw polygon with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | vx | Vertex array containing X coordinates of the points of the polygon.
  | vy | Vertex array containing Y coordinates of the points of the polygon.
  | n | Number of points in the vertex array. Minimum number is 3.
  | color | The color value of the polygon to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4908 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int polygonRGBA | ( | SDL_Surface * | dst,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw polygon with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | vx | Vertex array containing X coordinates of the points of the polygon.
  | vy | Vertex array containing Y coordinates of the points of the polygon.
  | n | Number of points in the vertex array. Minimum number is 3.
  | r | The red value of the polygon to draw.
  | g | The green value of the polygon to draw.
  | b | The blue value of the polygon to draw.
  | a | The alpha value of the polygon to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4976 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int rectangleColor | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Uint32 | color |
| ) |  |  |

Draw rectangle with blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point (i.e. top right) of the rectangle.
  | y1 | Y coordinate of the first point (i.e. top right) of the rectangle.
  | x2 | X coordinate of the second point (i.e. bottom left) of the rectangle.
  | y2 | Y coordinate of the second point (i.e. bottom left) of the rectangle.
  | color | The color value of the rectangle to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 1512 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int rectangleRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw rectangle with blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point (i.e. top right) of the rectangle.
  | y1 | Y coordinate of the first point (i.e. top right) of the rectangle.
  | x2 | X coordinate of the second point (i.e. bottom left) of the rectangle.
  | y2 | Y coordinate of the second point (i.e. bottom left) of the rectangle.
  | r | The red value of the rectangle to draw.
  | g | The green value of the rectangle to draw.
  | b | The blue value of the rectangle to draw.
  | a | The alpha value of the rectangle to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 1595 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int roundedBoxColor | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Sint16 | rad,
|  | Uint32 | color |
| ) |  |  |

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

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point (i.e. top right) of the box.
  | y1 | Y coordinate of the first point (i.e. top right) of the box.
  | x2 | X coordinate of the second point (i.e. bottom left) of the box.
  | y2 | Y coordinate of the second point (i.e. bottom left) of the box.
  | rad | The radius of the corner arcs of the box.
  | color | The color value of the box to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 1769 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int roundedBoxRGBA | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point (i.e. top right) of the box.
  | y1 | Y coordinate of the first point (i.e. top right) of the box.
  | x2 | X coordinate of the second point (i.e. bottom left) of the box.
  | y2 | Y coordinate of the second point (i.e. bottom left) of the box.
  | rad | The radius of the corner arcs of the box.
  | r | The red value of the box to draw.
  | g | The green value of the box to draw.
  | b | The blue value of the box to draw.
  | a | The alpha value of the box to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 1902 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int roundedRectangleColor | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Sint16 | rad,
|  | Uint32 | color |
| ) |  |  |

Draw rounded-corner rectangle with blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point (i.e. top right) of the rectangle.
  | y1 | Y coordinate of the first point (i.e. top right) of the rectangle.
  | x2 | X coordinate of the second point (i.e. bottom left) of the rectangle.
  | y2 | Y coordinate of the second point (i.e. bottom left) of the rectangle.
  | rad | The radius of the corner arc.
  | color | The color value of the rectangle to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 1617 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int roundedRectangleRGBA | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point (i.e. top right) of the rectangle.
  | y1 | Y coordinate of the first point (i.e. top right) of the rectangle.
  | x2 | X coordinate of the second point (i.e. bottom left) of the rectangle.
  | y2 | Y coordinate of the second point (i.e. bottom left) of the rectangle.
  | rad | The radius of the corner arc.
  | r | The red value of the rectangle to draw.
  | g | The green value of the rectangle to draw.
  | b | The blue value of the rectangle to draw.
  | a | The alpha value of the rectangle to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 1747 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int stringColor | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x | X (horizontal) coordinate of the upper left corner of the string.
  | y | Y (vertical) coordinate of the upper left corner of the string.
  | s | The string to draw.
  | color | The color value of the string to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 6009 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int stringRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y,
|  | const char * | s,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw a string in the currently set font.

Parameters:

  | dst | The surface to draw on.
  | x | X (horizontal) coordinate of the upper left corner of the string.
  | y | Y (vertical) coordinate of the upper left corner of the string.
  | s | The string to draw.
  | r | The red value of the string to draw.
  | g | The green value of the string to draw.
  | b | The blue value of the string to draw.
  | a | The alpha value of the string to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 6053 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int texturedPolygon | ( | SDL_Surface * | dst,
|  | 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:

  | dst | the destination surface,
  | vx | array of x vector components
  | vy | array of x vector components
  | n | the amount of vectors in the vx and vy array
  | texture | the sdl surface to use to fill the polygon
  | texture_dx | the 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_dy | see texture_dx

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 5651 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int texturedPolygonMT | ( | SDL_Surface * | dst,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n,
|  | SDL_Surface * | texture,
|  | int | texture_dx,
|  | int | texture_dy,
|  | int ** | polyInts,
|  | int * | polyAllocated |
| ) |  |  |

Draws a polygon filled with the given texture (Multi-Threading Capable).

This operation use internally SDL_BlitSurface for lines of the source texture. It supports alpha drawing.

To get the best performance of this operation you need to make sure the texture and the dst surface have the same format (see http://docs.mandragor.org/files/Common_libs_documentation/SDL/SDL_Documentation_project_en/sdlblitsurface.html). The last two parameters are optional, but required for multithreaded operation. When set to NULL, uses global static temp array.

Parameters:

  | dst | the destination surface,
  | vx | array of x vector components
  | vy | array of x vector components
  | n | the amount of vectors in the vx and vy array
  | texture | the sdl surface to use to fill the polygon
  | texture_dx | the 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_dy | see texture_dx
  | polyInts | preallocated temp array storage for vertex sorting (used for multi-threaded operation)
  | polyAllocated | flag indicating oif the temp array was allocated (used for multi-threaded operation)

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 5484 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int thickLineColor | ( | SDL_Surface * | dst,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Uint8 | width,
|  | Uint32 | color |
| ) |  |  |

Draw a thick line with alpha blending.

Parameters:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the line.
  | y1 | Y coordinate of the first point of the line.
  | x2 | X coordinate of the second point of the line.
  | y2 | Y coordinate of the second point of the line.
  | width | Width of the line in pixels. Must be >0.
  | color | The color value of the line to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 6718 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int thickLineRGBA | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the line.
  | y1 | Y coordinate of the first point of the line.
  | x2 | X coordinate of the second point of the line.
  | y2 | Y coordinate of the second point of the line.
  | width | Width of the line in pixels. Must be >0.
  | r | The red value of the character to draw.
  | g | The green value of the character to draw.
  | b | The blue value of the character to draw.
  | a | The alpha value of the character to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 6750 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int trigonColor | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the trigon.
  | y1 | Y coordinate of the first point of the trigon.
  | x2 | X coordinate of the second point of the trigon.
  | y2 | Y coordinate of the second point of the trigon.
  | x3 | X coordinate of the third point of the trigon.
  | y3 | Y coordinate of the third point of the trigon.
  | color | The color value of the trigon to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4713 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int trigonRGBA | ( | SDL_Surface * | dst,
|  | 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:

  | dst | The surface to draw on.
  | x1 | X coordinate of the first point of the trigon.
  | y1 | Y coordinate of the first point of the trigon.
  | x2 | X coordinate of the second point of the trigon.
  | y2 | Y coordinate of the second point of the trigon.
  | x3 | X coordinate of the third point of the trigon.
  | y3 | Y coordinate of the third point of the trigon.
  | r | The red value of the trigon to draw.
  | g | The green value of the trigon to draw.
  | b | The blue value of the trigon to draw.
  | a | The alpha value of the trigon to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 4745 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int vlineColor | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y1,
|  | Sint16 | y2,
|  | Uint32 | color |
| ) |  |  |

Draw vertical line with blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the points of the line.
  | y1 | Y coordinate of the first point (i.e. top) of the line.
  | y2 | Y coordinate of the second point (i.e. bottom) of the line.
  | color | The color value of the line to draw (0xRRGGBBAA).

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 1324 of file SDL_gfxPrimitives.c.

SDL_GFXPRIMITIVES_SCOPE int vlineRGBA | ( | SDL_Surface * | dst,
|  | Sint16 | x,
|  | Sint16 | y1,
|  | Sint16 | y2,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a |
| ) |  |  |

Draw vertical line with blending.

Parameters:

  | dst | The surface to draw on.
  | x | X coordinate of the points of the line.
  | y1 | Y coordinate of the first point (i.e. top) of the line.
  | y2 | Y coordinate of the second point (i.e. bottom) of the line.
  | r | The red value of the line to draw.
  | g | The green value of the line to draw.
  | b | The blue value of the line to draw.
  | a | The alpha value of the line to draw.

Returns:
  Returns 0 on success, -1 on failure.

Definition at line 1492 of file SDL_gfxPrimitives.c.