original 1.0.1 release
[xwelltris.git] / src / sdl / sdl_gfxprimitives.h
blob682db9224754629ae5ed038d21118909c43ede27
2 /*
4 SDL_gfxPrimitives: graphics primitives for SDL
6 LGPL (c) A. Schiffler
8 */
10 #ifndef _SDL_gfxPrimitives_h
11 #define _SDL_gfxPrimitives_h
13 #include <math.h>
14 #ifndef M_PI
15 #define M_PI 3.141592654
16 #endif
18 #include "SDL.h"
20 /* Set up for C function definitions, even when using C++ */
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
25 /* ----- Versioning */
27 #define SDL_GFXPRIMITIVES_MAJOR 1
28 #define SDL_GFXPRIMITIVES_MINOR 5
30 /* ----- W32 DLL interface */
32 #ifdef WIN32
33 #ifdef BUILD_DLL
34 #define DLLINTERFACE __declspec(dllexport)
35 #else
36 #define DLLINTERFACE __declspec(dllimport)
37 #endif
38 #else
39 #define DLLINTERFACE
40 #endif
42 /* ----- Prototypes */
44 /* Note: all ___Color routines expect the color to be in format 0xRRGGBBAA */
46 /* Pixel */
48 DLLINTERFACE int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color);
49 DLLINTERFACE int pixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
51 /* Horizontal line */
53 DLLINTERFACE int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color);
54 DLLINTERFACE int hlineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
56 /* Vertical line */
58 DLLINTERFACE int vlineColor(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color);
59 DLLINTERFACE int vlineRGBA(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
61 /* Rectangle */
63 DLLINTERFACE int rectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
64 DLLINTERFACE int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1,
65 Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
67 /* Filled rectangle (Box) */
69 DLLINTERFACE int boxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
70 DLLINTERFACE int boxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2,
71 Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
73 /* Line */
75 DLLINTERFACE int lineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
76 DLLINTERFACE int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1,
77 Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
79 /* AA Line */
80 DLLINTERFACE int aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
81 DLLINTERFACE int aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1,
82 Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
84 /* Circle */
86 DLLINTERFACE int circleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color);
87 DLLINTERFACE int circleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
89 /* AA Circle */
91 DLLINTERFACE int aacircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color);
92 DLLINTERFACE int aacircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y,
93 Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
95 /* Filled Circle */
97 DLLINTERFACE int filledCircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color);
98 DLLINTERFACE int filledCircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y,
99 Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
101 /* Ellipse */
103 DLLINTERFACE int ellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
104 DLLINTERFACE int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y,
105 Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
107 /* AA Ellipse */
109 DLLINTERFACE int aaellipseColor(SDL_Surface * dst, Sint16 xc, Sint16 yc, Sint16 rx, Sint16 ry, Uint32 color);
110 DLLINTERFACE int aaellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y,
111 Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
113 /* Filled Ellipse */
115 DLLINTERFACE int filledEllipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
116 DLLINTERFACE int filledEllipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y,
117 Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
118 /* Filled Pie */
120 DLLINTERFACE int filledpieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad,
121 Sint16 start, Sint16 end, Uint32 color);
122 DLLINTERFACE int filledpieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad,
123 Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
125 /* Polygon */
127 DLLINTERFACE int polygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint32 color);
128 DLLINTERFACE int polygonRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy,
129 int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
131 /* AA-Polygon */
133 DLLINTERFACE int aapolygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint32 color);
134 DLLINTERFACE int aapolygonRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy,
135 int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
137 /* Filled Polygon */
139 DLLINTERFACE int filledPolygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, int color);
140 DLLINTERFACE int filledPolygonRGBA(SDL_Surface * dst, Sint16 * vx,
141 Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
143 /* 8x8 Characters/Strings */
145 DLLINTERFACE int characterColor(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint32 color);
146 DLLINTERFACE int characterRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, char c, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
147 DLLINTERFACE int stringColor(SDL_Surface * dst, Sint16 x, Sint16 y, char *c, Uint32 color);
148 DLLINTERFACE int stringRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, char *c, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
150 /* Ends C function definitions when using C++ */
151 #ifdef __cplusplus
153 #endif
155 #endif /* _SDL_gfxPrimitives_h */