Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4680 | right-hear | 1 | /*! |
2 | \file SDL_draw.h |
||
3 | \author Mario Palomo Torrero |
||
4 | \author Jose M. de la Huerga Fernández |
||
5 | \author Pepe González Mora |
||
6 | \date 05-2002 |
||
7 | |||
8 | Drawing primitives for SDL. Main header file. |
||
9 | |||
10 | This library is free software; you can redistribute it and/or |
||
11 | modify it under the terms of the GNU Library General Public |
||
12 | License as published by the Free Software Foundation; either |
||
13 | version 2 of the License, or (at your option) any later version. |
||
14 | |||
15 | This library is distributed in the hope that it will be useful, |
||
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
||
18 | Library General Public License for more details. |
||
19 | |||
20 | You should have received a copy of the GNU Library General Public |
||
21 | License along with this library; if not, write to the Free Foundation, |
||
22 | Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
||
23 | */ |
||
24 | #ifndef SDL_DRAW_H |
||
25 | #define SDL_DRAW_H |
||
26 | |||
27 | #include "SDL.h" |
||
28 | #include "begin_code.h" |
||
29 | |||
30 | #ifdef __cplusplus |
||
31 | extern "C" { |
||
32 | #endif |
||
33 | |||
34 | |||
35 | extern DECLSPEC void Draw_Init(void); |
||
36 | |||
37 | extern DECLSPEC |
||
38 | void (*Draw_Pixel)(SDL_Surface *super, |
||
39 | Sint16 x, Sint16 y, Uint32 color); |
||
40 | |||
41 | extern DECLSPEC |
||
42 | void (*Draw_Line)(SDL_Surface *super, |
||
43 | Sint16 x1, Sint16 y1, Sint16 x2, Sint16 y2, |
||
44 | Uint32 color); |
||
45 | |||
46 | extern DECLSPEC |
||
47 | void (*Draw_Circle)(SDL_Surface *super, |
||
48 | Sint16 x0, Sint16 y0, Uint16 r, |
||
49 | Uint32 color); |
||
50 | |||
51 | extern DECLSPEC |
||
52 | void (*Draw_FillCircle)(SDL_Surface *super, |
||
53 | Sint16 x0, Sint16 y0, Uint16 r, |
||
54 | Uint32 color); |
||
55 | |||
56 | extern DECLSPEC |
||
57 | void (*Draw_HLine)(SDL_Surface *super, |
||
58 | Sint16 x0,Sint16 y0, Sint16 x1, |
||
59 | Uint32 color); |
||
60 | |||
61 | extern DECLSPEC |
||
62 | void (*Draw_VLine)(SDL_Surface *super, |
||
63 | Sint16 x0,Sint16 y0, Sint16 y1, |
||
64 | Uint32 color); |
||
65 | |||
66 | extern DECLSPEC |
||
67 | void (*Draw_Rect)(SDL_Surface *super, |
||
68 | Sint16 x,Sint16 y, Uint16 w,Uint16 h, |
||
69 | Uint32 color); |
||
70 | |||
71 | /* We wrap SDL_FillRect with the SDL_draw name convention */ |
||
72 | #define Draw_FillRect(SUPER, X, Y, W, H, COLOR) \ |
||
73 | do { \ |
||
74 | SDL_Rect r = {(X), (Y), (W), (H)}; \ |
||
75 | SDL_FillRect((SUPER), &r, (COLOR)); \ |
||
76 | }while(0) |
||
77 | |||
78 | |||
79 | extern DECLSPEC |
||
80 | void (*Draw_Ellipse)(SDL_Surface *super, |
||
81 | Sint16 x0, Sint16 y0, |
||
82 | Uint16 Xradius, Uint16 Yradius, |
||
83 | Uint32 color); |
||
84 | |||
85 | extern DECLSPEC |
||
86 | void (*Draw_FillEllipse)(SDL_Surface *super, |
||
87 | Sint16 x0, Sint16 y0, |
||
88 | Uint16 Xradius, Uint16 Yradius, |
||
89 | Uint32 color); |
||
90 | |||
91 | extern DECLSPEC |
||
92 | void (*Draw_Round)(SDL_Surface *super, |
||
93 | Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
||
94 | Uint16 corner, Uint32 color); |
||
95 | |||
96 | extern DECLSPEC |
||
97 | void (*Draw_FillRound)(SDL_Surface *super, |
||
98 | Sint16 x0,Sint16 y0, Uint16 w,Uint16 h, |
||
99 | Uint16 corner, Uint32 color); |
||
100 | |||
101 | |||
102 | /* We'll use SDL for reporting errors */ |
||
103 | #define Draw_SetError SDL_SetError |
||
104 | #define Draw_GetError SDL_GetError |
||
105 | |||
106 | |||
107 | #ifdef __cplusplus |
||
108 | } /* extern "C" */ |
||
109 | #endif |
||
110 | |||
111 | #include "close_code.h" |
||
112 | |||
113 | #endif /* SDL_DRAW_H */ |
||
114 |