SDL2_gfxPrimitives.c File Reference
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <math.h>`
`#include <string.h>`
`#include "SDL2_gfxPrimitives.h"`
`#include "SDL2_rotozoom.h"`
`#include "SDL2_gfxPrimitives_font.h"`

Go to the source code of this file.

## Data Structures

struct | SDL2_gfxBresenhamIterator
| The structure passed to the internal Bresenham iterator. More...
struct | SDL2_gfxMurphyIterator
| The structure passed to the internal Murphy iterator. More...

## Macros

#define | AAlevels 256
#define | AAbits 8
#define | DEFAULT_ELLIPSE_OVERSCAN 4
| Internal function to draw ellipse or filled ellipse with blending.

## Functions

int | pixel (SDL_Renderer *renderer, Sint16 x, Sint16 y)
| Draw pixel in currently set color.
int | pixelColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint32 color)
| Draw pixel with blending enabled if a<255.
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.
int | pixelRGBAWeight (SDL_Renderer *renderer, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Uint32 weight)
| Draw pixel with blending enabled and using alpha weight on color.
int | hline (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y)
| Draw horizontal line in currently set color.
int | hlineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color)
| Draw horizontal line with blending.
int | hlineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
| Draw horizontal line with blending.
int | vline (SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2)
| Draw vertical line in currently set color.
int | vlineColor (SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color)
| Draw vertical line with blending.
int | vlineRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
| Draw vertical line with blending.
int | rectangleColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
| Draw rectangle with blending.
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.
int | roundedRectangleColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 rad, Uint32 color)
| Draw rounded-corner rectangle with blending.
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.
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.
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.
int | boxColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
| Draw box (filled rectangle) with blending.
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.
int | line (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2)
| Draw line with alpha blending using the currently set color.
int | lineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
| Draw line with alpha blending.
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.
int | _aalineRGBA (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a, int draw_endpoint)
| Internal function to draw anti-aliased line with alpha blending and endpoint control.
int | aalineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color)
| Draw anti-aliased line with alpha blending.
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.
int | circleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
| Draw circle with blending.
int | circleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
| Draw circle with blending.
int | arcColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
| Arc with blending.
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.
int | aacircleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
| Draw anti-aliased circle with blending.
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.
int | _drawQuadrants (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 dx, Sint16 dy, Sint32 f)
| Internal function to draw pixels or lines in 4 quadrants.
int | _ellipseRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Sint32 f)
int | ellipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
| Draw ellipse with blending.
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.
int | filledCircleColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint32 color)
| Draw filled circle with blending.
int | filledCircleRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
| Draw filled circle with blending.
int | aaellipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
| Draw anti-aliased ellipse with blending.
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.
int | filledEllipseColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color)
| Draw filled ellipse with blending.
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.
int | _pieRGBA (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a, Uint8 filled)
| Internal float (low-speed) pie-calc implementation by drawing polygons.
int | pieColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
| Draw pie (outline) with alpha blending.
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.
int | filledPieColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, Sint16 rad, Sint16 start, Sint16 end, Uint32 color)
| Draw filled pie with alpha blending.
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.
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.
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.
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.
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.
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.
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.
int | polygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
| Draw polygon with alpha blending.
int | polygon (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n)
| Draw polygon with the currently set color and blend mode.
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.
int | aapolygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
| Draw anti-aliased polygon with alpha blending.
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.
int | _gfxPrimitivesCompareInt (const void *a, const void *b)
| Internal helper qsort callback functions used in filled polygon drawing.
int | filledPolygonRGBAMT (SDL_Renderer *renderer, 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).
int | filledPolygonColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, Uint32 color)
| Draw filled polygon with alpha blending.
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.
int | _HLineTextured (SDL_Renderer *renderer, Sint16 x1, Sint16 x2, Sint16 y, SDL_Texture *texture, int texture_w, int texture_h, int texture_dx, int texture_dy)
| Internal function to draw a textured horizontal line.
int | texturedPolygonMT (SDL_Renderer *renderer, 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).
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.
void | gfxPrimitivesSetFont (const void *fontdata, Uint32 cw, Uint32 ch)
| Sets or resets the current global font data.
void | gfxPrimitivesSetFontRotation (Uint32 rotation)
| Sets current global font character rotation steps.
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.
int | characterColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, char c, Uint32 color)
| Draw a character of the currently set font.
int | stringColor (SDL_Renderer *renderer, Sint16 x, Sint16 y, const char *s, Uint32 color)
| Draw a string in the currently set font.
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.
double | _evaluateBezier (double *data, int ndata, double t)
| Internal function to calculate bezier interpolator of data array with ndata values at position 't'.
int | bezierColor (SDL_Renderer *renderer, const Sint16 *vx, const Sint16 *vy, int n, int s, Uint32 color)
| Draw a bezier curve with alpha blending.
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.
int | thickLineColor (SDL_Renderer *renderer, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint8 width, Uint32 color)
| Draw a thick line with alpha blending.
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.

## Macro Definition Documentation

## AAbits

#define AAbits 8

Definition at line 857 of file SDL2_gfxPrimitives.c.

## AAlevels

#define AAlevels 256

Definition at line 856 of file SDL2_gfxPrimitives.c.

## DEFAULT_ELLIPSE_OVERSCAN

#define DEFAULT_ELLIPSE_OVERSCAN 4

Internal function to draw ellipse or filled ellipse with blending.

Parameters

  renderer | The renderer 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.
  f | Flag indicating if the ellipse should be filled (1) or not (0).

Returns
  Returns 0 on success, -1 on failure.

Definition at line 1529 of file SDL2_gfxPrimitives.c.

## Function Documentation

## _aalineRGBA()

int _aalineRGBA | ( | SDL_Renderer * | renderer,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a,
|  | int | draw_endpoint )

Internal function to draw anti-aliased line with alpha blending and endpoint control.

This implementation of the Wu antialiasing code is based on Mike Abrash's DDJ article which was reprinted as Chapter 42 of his Graphics Programming Black Book, but has been optimized to work with SDL and utilizes 32-bit fixed-point arithmetic by A. Schiffler. The endpoint control allows the supression to draw the last pixel useful for rendering continous aa-lines with alpha<255.

Parameters

  renderer | The renderer 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.
  draw_endpoint | Flag indicating if the endpoint should be drawn; draw if non-zero.

Returns
  Returns 0 on success, -1 on failure.

Definition at line 882 of file SDL2_gfxPrimitives.c.

## _drawQuadrants()

int _drawQuadrants | ( | SDL_Renderer * | renderer,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | dx,
|  | Sint16 | dy,
|  | Sint32 | f )

Internal function to draw pixels or lines in 4 quadrants.

Parameters

  renderer | The renderer to draw on.
  x | X coordinate of the center of the quadrant.
  y | Y coordinate of the center of the quadrant.
  dx | X offset in pixels of the corners of the quadrant.
  dy | Y offset in pixels of the corners of the quadrant.
  f | Flag indicating if the quadrant should be filled (1) or not (0).

Returns
  Returns 0 on success, -1 on failure.

Definition at line 1475 of file SDL2_gfxPrimitives.c.

## _ellipseRGBA()

int _ellipseRGBA | ( | SDL_Renderer * | renderer,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rx,
|  | Sint16 | ry,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a,
|  | Sint32 | f )

Definition at line 1530 of file SDL2_gfxPrimitives.c.

## _evaluateBezier()

double _evaluateBezier | ( | double * | data,
|  | int | ndata,
|  | double | t )

Internal function to calculate bezier interpolator of data array with ndata values at position 't'.

Parameters

  data | Array of values.
  ndata | Size of array.
  t | Position for which to calculate interpolated value. t should be between [0, ndata].

Returns
  Interpolated value at position t, value[0] when t<0, value[n-1] when t>n.

Definition at line 3576 of file SDL2_gfxPrimitives.c.

## _gfxPrimitivesCompareInt()

int _gfxPrimitivesCompareInt | ( | const void * | a,
|  | const void * | b )

Internal helper qsort callback functions used in filled polygon drawing.

Parameters

  a | The surface to draw on.
  b | Vertex array containing X coordinates of the points of the polygon.

Returns
  Returns 0 if a==b, a negative number if a<b or a positive number if a>b.

Definition at line 2694 of file SDL2_gfxPrimitives.c.

## _HLineTextured()

int _HLineTextured | ( | SDL_Renderer * | renderer,
|  | Sint16 | x1,
|  | Sint16 | x2,
|  | Sint16 | y,
|  | SDL_Texture * | texture,
|  | int | texture_w,
|  | int | texture_h,
|  | int | texture_dx,
|  | int | texture_dy )

Internal function to draw a textured horizontal line.

Parameters

  renderer | The renderer 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.
  texture | The texture to retrieve color information from.
  texture_w | The width of the texture.
  texture_h | The height of the texture.
  texture_dx | The X offset for the texture lookup.
  texture_dy | The Y offset for the textured lookup.

Returns
  Returns 0 on success, -1 on failure.

Definition at line 2941 of file SDL2_gfxPrimitives.c.

## _pieRGBA()

int _pieRGBA | ( | SDL_Renderer * | renderer,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Sint16 | rad,
|  | Sint16 | start,
|  | Sint16 | end,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a,
|  | Uint8 | filled )

Internal float (low-speed) pie-calc implementation by drawing polygons.

Note: Determines vertex array and uses polygon or filledPolygon drawing routines to render.

Parameters

  renderer | The renderer 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.
  filled | Flag indicating if the pie should be filled (=1) or not (=0).

Returns
  Returns 0 on success, -1 on failure.

Definition at line 2075 of file SDL2_gfxPrimitives.c.

## aacircleColor()

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

Draw anti-aliased circle with blending.

Parameters

  renderer | The renderer 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 1433 of file SDL2_gfxPrimitives.c.

## aacircleRGBA()

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

  renderer | The renderer 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 1453 of file SDL2_gfxPrimitives.c.

## aaellipseColor()

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

Draw anti-aliased ellipse with blending.

Parameters

  renderer | The renderer 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 1811 of file SDL2_gfxPrimitives.c.

## aaellipseRGBA()

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

  renderer | The renderer 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 1832 of file SDL2_gfxPrimitives.c.

## aalineColor()

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

Draw anti-aliased line with alpha blending.

Parameters

  renderer | The renderer 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 1096 of file SDL2_gfxPrimitives.c.

## aalineRGBA()

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

  renderer | The renderer 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 1117 of file SDL2_gfxPrimitives.c.

## aapolygonColor()

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

Draw anti-aliased polygon with alpha blending.

Parameters

  renderer | The renderer 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 2616 of file SDL2_gfxPrimitives.c.

## aapolygonRGBA()

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

  renderer | The renderer 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 2636 of file SDL2_gfxPrimitives.c.

## aatrigonColor()

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

  renderer | The renderer 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 2344 of file SDL2_gfxPrimitives.c.

## aatrigonRGBA()

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

  renderer | The renderer 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 2376 of file SDL2_gfxPrimitives.c.

## arcColor()

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

Arc with blending.

Parameters

  renderer | The renderer 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 1175 of file SDL2_gfxPrimitives.c.

## arcRGBA()

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

  renderer | The renderer 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 1198 of file SDL2_gfxPrimitives.c.

## bezierColor()

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

  renderer | The renderer 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 3635 of file SDL2_gfxPrimitives.c.

## bezierRGBA()

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

  renderer | The renderer 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 3656 of file SDL2_gfxPrimitives.c.

## boxColor()

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

Draw box (filled rectangle) with blending.

Parameters

  renderer | The renderer 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 710 of file SDL2_gfxPrimitives.c.

## boxRGBA()

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

  renderer | The renderer 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 731 of file SDL2_gfxPrimitives.c.

## characterColor()

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

Draw a character of the currently set font.

Parameters

  renderer | The renderer 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 3494 of file SDL2_gfxPrimitives.c.

## characterRGBA()

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

  renderer | The Renderer 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 3372 of file SDL2_gfxPrimitives.c.

## circleColor()

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

Draw circle with blending.

Parameters

  renderer | The renderer 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 1135 of file SDL2_gfxPrimitives.c.

## circleRGBA()

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

Draw circle with blending.

Parameters

  renderer | The renderer 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 1155 of file SDL2_gfxPrimitives.c.

## ellipseColor()

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

Draw ellipse with blending.

Parameters

  renderer | The renderer 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 1692 of file SDL2_gfxPrimitives.c.

## ellipseRGBA()

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

  renderer | The renderer 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 1713 of file SDL2_gfxPrimitives.c.

## filledCircleColor()

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

Draw filled circle with blending.

Parameters

  renderer | The renderer 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 1731 of file SDL2_gfxPrimitives.c.

## filledCircleRGBA()

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

  renderer | The renderer 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 1751 of file SDL2_gfxPrimitives.c.

## filledEllipseColor()

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

Draw filled ellipse with blending.

Parameters

  renderer | The renderer 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 2027 of file SDL2_gfxPrimitives.c.

## filledEllipseRGBA()

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

  renderer | The renderer 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 2048 of file SDL2_gfxPrimitives.c.

## filledPieColor()

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

Draw filled pie with alpha blending.

Parameters

  renderer | The renderer 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 2232 of file SDL2_gfxPrimitives.c.

## filledPieRGBA()

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

  renderer | The renderer 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 2254 of file SDL2_gfxPrimitives.c.

## filledPolygonColor()

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

Draw filled polygon with alpha blending.

Parameters

  renderer | The renderer 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 2899 of file SDL2_gfxPrimitives.c.

## filledPolygonRGBA()

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

  renderer | The renderer 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 2919 of file SDL2_gfxPrimitives.c.

## filledPolygonRGBAMT()

int filledPolygonRGBAMT | ( | SDL_Renderer * | renderer,
|  | 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

  renderer | The renderer 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 filled 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 2731 of file SDL2_gfxPrimitives.c.

## filledTrigonColor()

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

  renderer | The renderer 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 2410 of file SDL2_gfxPrimitives.c.

## filledTrigonRGBA()

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

  renderer | The renderer 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 2444 of file SDL2_gfxPrimitives.c.

## gfxPrimitivesSetFont()

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 3280 of file SDL2_gfxPrimitives.c.

## gfxPrimitivesSetFontRotation()

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 3326 of file SDL2_gfxPrimitives.c.

## hline()

int hline | ( | SDL_Renderer * | renderer,
|  | Sint16 | x1,
|  | Sint16 | x2,
|  | Sint16 | y )

Draw horizontal line in currently set color.

Parameters

  renderer | The renderer 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.

Returns
  Returns 0 on success, -1 on failure.

Definition at line 158 of file SDL2_gfxPrimitives.c.

## hlineColor()

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

Draw horizontal line with blending.

Parameters

  renderer | The renderer 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 175 of file SDL2_gfxPrimitives.c.

## hlineRGBA()

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

  renderer | The renderer 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 195 of file SDL2_gfxPrimitives.c.

## line()

int line | ( | SDL_Renderer * | renderer,
|  | Sint16 | x1,
|  | Sint16 | y1,
|  | Sint16 | x2,
|  | Sint16 | y2 )

Draw line with alpha blending using the currently set color.

Parameters

  renderer | The renderer 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.

Returns
  Returns 0 on success, -1 on failure.

Definition at line 801 of file SDL2_gfxPrimitives.c.

## lineColor()

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

Draw line with alpha blending.

Parameters

  renderer | The renderer 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 seond 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 821 of file SDL2_gfxPrimitives.c.

## lineRGBA()

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

  renderer | The renderer 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 842 of file SDL2_gfxPrimitives.c.

## pieColor()

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

Draw pie (outline) with alpha blending.

Parameters

  renderer | The renderer 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 2190 of file SDL2_gfxPrimitives.c.

## pieRGBA()

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

  renderer | The renderer 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 2213 of file SDL2_gfxPrimitives.c.

## pixel()

int pixel | ( | SDL_Renderer * | renderer,
|  | Sint16 | x,
|  | Sint16 | y )

Draw pixel in currently set color.

Parameters

  renderer | The renderer to draw on.
  x | X (horizontal) coordinate of the pixel.
  y | Y (vertical) coordinate of the pixel.

Returns
  Returns 0 on success, -1 on failure.

Definition at line 73 of file SDL2_gfxPrimitives.c.

## pixelColor()

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

Draw pixel with blending enabled if a<255.

Parameters

  renderer | The renderer 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 88 of file SDL2_gfxPrimitives.c.

## pixelRGBA()

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

  renderer | The renderer 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 107 of file SDL2_gfxPrimitives.c.

## pixelRGBAWeight()

int pixelRGBAWeight | ( | SDL_Renderer * | renderer,
|  | Sint16 | x,
|  | Sint16 | y,
|  | Uint8 | r,
|  | Uint8 | g,
|  | Uint8 | b,
|  | Uint8 | a,
|  | Uint32 | weight )

Draw pixel with blending enabled and using alpha weight on color.

Parameters

  renderer | The renderer to draw on.
  x | The horizontal coordinate of the pixel.
  y | The vertical position 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.
  weight | The weight multiplied into the alpha value of the pixel.

Returns
  Returns 0 on success, -1 on failure.

Definition at line 130 of file SDL2_gfxPrimitives.c.

## polygon()

int polygon | ( | SDL_Renderer * | renderer,
|  | const Sint16 * | vx,
|  | const Sint16 * | vy,
|  | int | n )

Draw polygon with the currently set color and blend mode.

Parameters

  renderer | The renderer 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.

Returns
  Returns 0 on success, -1 on failure.

Definition at line 2489 of file SDL2_gfxPrimitives.c.

## polygonColor()

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

Draw polygon with alpha blending.

Parameters

  renderer | The renderer 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 2473 of file SDL2_gfxPrimitives.c.

## polygonRGBA()

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

  renderer | The renderer 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 2555 of file SDL2_gfxPrimitives.c.

## rectangleColor()

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

Draw rectangle with blending.

Parameters

  renderer | The renderer 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 275 of file SDL2_gfxPrimitives.c.

## rectangleRGBA()

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

  renderer | The renderer 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 296 of file SDL2_gfxPrimitives.c.

## roundedBoxColor()

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

  renderer | The renderer 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 513 of file SDL2_gfxPrimitives.c.

## roundedBoxRGBA()

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

  renderer | The renderer 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 535 of file SDL2_gfxPrimitives.c.

## roundedRectangleColor()

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

Draw rounded-corner rectangle with blending.

Parameters

  renderer | The renderer 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 368 of file SDL2_gfxPrimitives.c.

## roundedRectangleRGBA()

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

  renderer | The renderer 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 390 of file SDL2_gfxPrimitives.c.

## stringColor()

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

  renderer | The renderer 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 3515 of file SDL2_gfxPrimitives.c.

## stringRGBA()

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

  renderer | The renderer 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 3535 of file SDL2_gfxPrimitives.c.

## texturedPolygon()

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

  renderer | The renderer to draw on.
  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 3212 of file SDL2_gfxPrimitives.c.

## texturedPolygonMT()

int texturedPolygonMT | ( | SDL_Renderer * | renderer,
|  | 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).

Parameters

  renderer | The renderer to draw on.
  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 3040 of file SDL2_gfxPrimitives.c.

## thickLineColor()

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

  renderer | The renderer 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 3736 of file SDL2_gfxPrimitives.c.

## thickLineRGBA()

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

  renderer | The renderer 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 3758 of file SDL2_gfxPrimitives.c.

## trigonColor()

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

  renderer | The renderer 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 2278 of file SDL2_gfxPrimitives.c.

## trigonRGBA()

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

  renderer | The renderer 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 2310 of file SDL2_gfxPrimitives.c.

## vline()

int vline | ( | SDL_Renderer * | renderer,
|  | Sint16 | x,
|  | Sint16 | y1,
|  | Sint16 | y2 )

Draw vertical line in currently set color.

Parameters

  renderer | The renderer to draw on.
  x | X coordinate of 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.

Returns
  Returns 0 on success, -1 on failure.

Definition at line 216 of file SDL2_gfxPrimitives.c.

## vlineColor()

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

Draw vertical line with blending.

Parameters

  renderer | The renderer 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 232 of file SDL2_gfxPrimitives.c.

## vlineRGBA()

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

  renderer | The renderer 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 252 of file SDL2_gfxPrimitives.c.