1 /*****************************************************************************/
9 /* (C) 2001 Ullrich von Bassewitz */
11 /* D-70597 Stuttgart */
12 /* EMail: uz@musoftware.de */
15 /* This software is provided 'as-is', without any expressed or implied */
16 /* warranty. In no event will the authors be held liable for any damages */
17 /* arising from the use of this software. */
19 /* Permission is granted to anyone to use this software for any purpose, */
20 /* including commercial applications, and to alter it and redistribute it */
21 /* freely, subject to the following restrictions: */
23 /* 1. The origin of this software must not be misrepresented; you must not */
24 /* claim that you wrote the original software. If you use this software */
25 /* in a product, an acknowledgment in the product documentation would be */
26 /* appreciated but is not required. */
27 /* 2. Altered source versions must be plainly marked as such, and must not */
28 /* be misrepresented as being the original software. */
29 /* 3. This notice may not be removed or altered from any source */
32 /*****************************************************************************/
41 /*****************************************************************************/
43 /*****************************************************************************/
47 #define GM_TEXT 0U /* Text mode */
48 #define GM_320_200_2 1U /* 320x200, 2 colors (b/w) */
49 #define GM_160_200_4 2U /* 160x200, 4 colors */
53 /*****************************************************************************/
55 /*****************************************************************************/
60 unsigned char r; /* Red component */
61 unsigned char g; /* Green component */
62 unsigned char b; /* Blue component */
67 /*****************************************************************************/
69 /*****************************************************************************/
73 unsigned char __fastcall__ initgraph (unsigned char mode);
74 /* Initialize the graphics screen to the given mode, return the new mode.
75 * Not all modes are available on all systems, check the returned mode
76 * to see if the initialization was successful.
79 void closegraph (void);
80 /* End graphics mode, switch back to text mode */
82 void cleargraphscreen (void);
83 /* Clear the screen */
85 unsigned char getgraphmode (void);
86 /* Return the current graphics mode */
88 unsigned char getmaxcolor (void);
89 /* Return the maximum supported color number (the number of colors would
90 * then be getmaxcolor()+1).
93 unsigned getmaxx (void);
94 /* Return the maximum x coordinate. The resolution in x direction is
98 unsigned getmaxy (void);
99 /* Return the maximum y coordinate. The resolution in y direction is
103 void __fastcall__ getaspectratio (unsigned* xasp, unsigned* yasp);
104 /* Get the aspect ratio for the current graphics mode. yasp will always be
105 * 10000, xasp depends on the maxx/mayy ratio of the current resolution.
108 void __fastcall__ setcolor (unsigned char color);
109 /* Set the current drawing color */
111 unsigned char getcolor (void);
112 /* Return the current drawing color */
114 unsigned char getbkcolor (void);
115 /* Return the current background color */
117 void __fastcall__ setbkcolor (unsigned char color);
118 /* Set the background color */
120 void __fastcall__ setpalette (unsigned num, const struct palettetype* palette);
121 /* Set one palette entry */
123 void __fastcall__ getpalette (unsigned num, struct palettetype* palette);
124 /* Get one palette entry */
126 void __fastcall__ setallpalette (const struct palettetype* allpalette);
127 /* Set all palette entries */
129 unsigned char __fastcall__ getpixel (int x, int y);
130 /* Get the color value of a pixel */
132 void __fastcall__ putpixel (int x, int y);
133 /* Plot a point in the current drawing color */
135 void __fastcall__ line (int x1, int y1, int x2, int y2);
136 /* Draw a line in the current drawing color */
138 void __fastcall__ circle (int x, int y, unsigned radius);
139 /* Draw a circle in the current drawing color */
141 void __fastcall__ outtext (int x, int y, const char* text);
142 /* Print a text in graphics mode */
144 void __fastcall__ bar (int x1, int y1, int x2, int y2);
145 /* Draw a bar (a filled rectangle) using the current color */
149 /* End of graphics.h */