Main Page | Class Hierarchy | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

SDL_gfxPrimitives.h

Go to the documentation of this file.
00001 /* 
00002 
00003  SDL_gfxPrimitives: graphics primitives for SDL
00004 
00005  LGPL (c) A. Schiffler
00006  
00007 */
00008 
00009 #ifndef _SDL_gfxPrimitives_h
00010 #define _SDL_gfxPrimitives_h
00011 
00012 #include <math.h>
00013 #ifndef M_PI
00014 #define M_PI   3.141592654
00015 #endif
00016 
00017 #include "SDL.h"
00018 
00019 /* Set up for C function definitions, even when using C++ */
00020 #ifdef __cplusplus
00021 extern "C" {
00022 #endif
00023 
00024 /* ----- Versioning */
00025 
00026 #define SDL_GFXPRIMITIVES_MAJOR  2
00027 #define SDL_GFXPRIMITIVES_MINOR  0
00028 #define SDL_GFXPRIMITIVES_MICRO  10
00029 
00030 /* ----- Prototypes */
00031 
00032 /* Note: all ___Color routines expect the color to be in format 0xRRGGBBAA */
00033 
00034 /* Pixel */
00035 
00036     extern int pixelColor(SDL_Surface * dst, Sint16 x, Sint16 y, Uint32 color);
00037     extern int pixelRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00038 
00039 /* Horizontal line */
00040 
00041     extern int hlineColor(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint32 color);
00042     extern int hlineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 x2, Sint16 y, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00043 
00044 /* Vertical line */
00045 
00046     extern int vlineColor(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint32 color);
00047     extern int vlineRGBA(SDL_Surface * dst, Sint16 x, Sint16 y1, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00048 
00049 /* Rectangle */
00050 
00051     extern int rectangleColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
00052     extern int rectangleRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1,
00053                Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00054 
00055 /* Filled rectangle (Box) */
00056 
00057     extern int boxColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
00058     extern int boxRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2,
00059               Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00060 
00061 /* Line */
00062 
00063     extern int lineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
00064     extern int lineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1,
00065                Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00066 
00067 /* AA Line */
00068     extern int aalineColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Uint32 color);
00069     extern int aalineRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1,
00070             Sint16 x2, Sint16 y2, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00071 
00072 /* Circle */
00073 
00074     extern int circleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color);
00075     extern int circleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00076 
00077 /* AA Circle */
00078 
00079     extern int aacircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color);
00080     extern int aacircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y,
00081               Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00082 
00083 /* Filled Circle */
00084 
00085     extern int filledCircleColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 r, Uint32 color);
00086     extern int filledCircleRGBA(SDL_Surface * dst, Sint16 x, Sint16 y,
00087                   Sint16 rad, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00088 
00089 /* Ellipse */
00090 
00091     extern int ellipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
00092     extern int ellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y,
00093              Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00094 
00095 /* AA Ellipse */
00096 
00097     extern int aaellipseColor(SDL_Surface * dst, Sint16 xc, Sint16 yc, Sint16 rx, Sint16 ry, Uint32 color);
00098     extern int aaellipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y,
00099                Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00100 
00101 /* Filled Ellipse */
00102 
00103     extern int filledEllipseColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rx, Sint16 ry, Uint32 color);
00104     extern int filledEllipseRGBA(SDL_Surface * dst, Sint16 x, Sint16 y,
00105                    Sint16 rx, Sint16 ry, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00106 /* Filled Pie */
00107 
00108     extern int filledpieColor(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad,
00109                 Sint16 start, Sint16 end, Uint32 color);
00110     extern int filledpieRGBA(SDL_Surface * dst, Sint16 x, Sint16 y, Sint16 rad,
00111                Sint16 start, Sint16 end, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00112 
00113 /* Trigon */
00114 
00115     extern int trigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
00116     extern int trigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
00117              Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00118 
00119 /* AA-Trigon */
00120 
00121     extern int aatrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, Uint32 color);
00122     extern int aatrigonRGBA(SDL_Surface * dst,  Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
00123                Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00124 
00125 /* Filled Trigon */
00126 
00127     extern int filledTrigonColor(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3, int color);
00128     extern int filledTrigonRGBA(SDL_Surface * dst, Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, Sint16 x3, Sint16 y3,
00129                    Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00130 
00131 /* Polygon */
00132 
00133     extern int polygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint32 color);
00134     extern int polygonRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy,
00135              int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00136 
00137 /* AA-Polygon */
00138 
00139     extern int aapolygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, Uint32 color);
00140     extern int aapolygonRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy,
00141                int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00142 
00143 /* Filled Polygon */
00144 
00145     extern int filledPolygonColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, int color);
00146     extern int filledPolygonRGBA(SDL_Surface * dst, Sint16 * vx,
00147                    Sint16 * vy, int n, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00148 
00149 /* Bezier */
00150 /* s = number of steps */
00151 
00152     extern int bezierColor(SDL_Surface * dst, Sint16 * vx, Sint16 * vy, int n, int s, Uint32 color);
00153     extern int bezierRGBA(SDL_Surface * dst, Sint16 * vx, Sint16 * vy,
00154              int n, int s, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
00155 
00156 /* Ends C function definitions when using C++ */
00157 #ifdef __cplusplus
00158 };
00159 #endif
00160 
00161 #endif            /* _SDL_gfxPrimitives_h */

Generated on Wed Jun 1 09:54:31 2005 for Fish Fillets - Next Generation by  doxygen 1.4.2