libkovan  1
The kovan standard library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
graphics.h
Go to the documentation of this file.
1 #ifndef _GRAPHICS_H_
2 #define _GRAPHICS_H_
3 
12 #include <kovan/export.h>
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
25 EXPORT_SYM int graphics_open(int width, int height);
26 
32 
39 
45 
46 typedef enum Encoding {
47  RGB,
49 } Encoding;
50 
51 
56 EXPORT_SYM void graphics_blit(const unsigned char *data, int x, int y, int width, int height);
57 
62 EXPORT_SYM void graphics_blit_region(const unsigned char *data, int sx, int sy, int ex, int ey, int width, int height, int dx, int dy);
63 
75 EXPORT_SYM void graphics_blit_enc (const unsigned char *data, Encoding enc, int x, int y, int width, int height);
76 
92 EXPORT_SYM void graphics_blit_region_enc(const unsigned char *data, Encoding enc, int sx, int sy, int ex, int ey, int width, int height, int dx, int dy);
93 
101 EXPORT_SYM void graphics_fill(int r, int g, int b);
102 
110 EXPORT_SYM void graphics_pixel(int x, int y, int r, int g, int b);
111 
119 EXPORT_SYM void graphics_line(int x1, int y1, int x2, int y2, int r, int g, int b);
120 
128 EXPORT_SYM void graphics_circle(int cx, int cy, int radius, int r, int g, int b);
129 
137 EXPORT_SYM void graphics_circle_fill(int cx, int cy, int radius, int r, int g, int b);
138 
150 EXPORT_SYM void graphics_rectangle(int x1, int y1, int x2, int y2, int r, int g, int b);
151 
163 EXPORT_SYM void graphics_rectangle_fill(int x1, int y1, int x2, int y2, int r, int g, int b);
164 
172 EXPORT_SYM void graphics_triangle(int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b);
173 
181 EXPORT_SYM void graphics_triangle_fill(int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b);
182 
184 {
185  KeyEnter = '\n',
186  KeyBackSpace = '\b',
187  KeyTab = '\t',
188  KeyCancel = 0x03,
189  KeyClear = 0x0C,
190  KeyShift = 0x10,
191  KeyControl = 0x11,
192  KeyAlt = 0x12,
193  KeyPause = 0x13,
194  KeyCapsLock = 0x14,
195  KeyEscape = 0x1B,
196  KeySpace = 0x20,
197  KeyPageUp = 0x21,
198  KeyPageDown = 0x22,
199  KeyEnd = 0x23,
200  KeyHome = 0x24,
201  KeyLeft = 0x25,
202  KeyUp = 0x26,
203  KeyRight = 0x27,
204  KeyDown = 0x28,
205  KeyComma = 0x2C,
206  KeyPeriod = 0x2E,
207  KeySlash = 0x2F,
208  KeyZero = 0x30,
209  KeyOne = 0x31,
210  KeyTwo = 0x32,
211  KeyThree = 0x33,
212  KeyFour = 0x34,
213  KeyFive = 0x35,
214  KeySix = 0x36,
215  KeySeven = 0x37,
216  KeyEight = 0x38,
217  KeyNine = 0x39,
218  KeySemiColon = 0x3B,
219  KeyEquals = 0x3D,
220  KeyA = 0x41,
221  KeyB = 0x42,
222  KeyC = 0x43,
223  KeyD = 0x44,
224  KeyE = 0x45,
225  KeyF = 0x46,
226  KeyG = 0x47,
227  KeyH = 0x48,
228  KeyI = 0x49,
229  KeyJ = 0x4A,
230  KeyK = 0x4B,
231  KeyL = 0x4C,
232  KeyM = 0x4D,
233  KeyN = 0x4E,
234  KeyO = 0x4F,
235  KeyP = 0x50,
236  KeyQ = 0x51,
237  KeyR = 0x52,
238  KeyS = 0x53,
239  KeyT = 0x54,
240  KeyU = 0x55,
241  KeyV = 0x56,
242  KeyW = 0x57,
243  KeyX = 0x58,
244  KeyY = 0x59,
245  KeyZ = 0x5A,
246  KeyOpenBracket = 0x5B,
247  KeyBackSlash = 0x5C,
249  KeyNumPad0 = 0x60,
250  KeyNumPad1 = 0x61,
251  KeyNumPad2 = 0x62,
252  KeyNumPad3 = 0x63,
253  KeyNumPad4 = 0x64,
254  KeyNumPad5 = 0x65,
255  KeyNumPad6 = 0x66,
256  KeyNumPad7 = 0x67,
257  KeyNumPad8 = 0x68,
258  KeyNumPad9 = 0x69,
259  KeyMultiply = 0x6A,
260  KeyAdd = 0x6B,
261  KeySeparator = 0x6C,
262  KeySubtract = 0x6D,
263  KeyDecimal = 0x6E,
264  KeyDivide = 0x6F,
265  KeyF1 = 0x70,
266  KeyF2 = 0x71,
267  KeyF3 = 0x72,
268  KeyF4 = 0x73,
269  KeyF5 = 0x74,
270  KeyF6 = 0x75,
271  KeyF7 = 0x76,
272  KeyF8 = 0x77,
273  KeyF9 = 0x78,
274  KeyF10 = 0x79,
275  KeyF11 = 0x7A,
276  KeyF12 = 0x7B,
277  KeyDelete = 0x7F,
278  KeyNumLock = 0x90,
279  KeyScrollLock = 0x91,
280  KeyPrintScreen = 0x9A,
281  KeyInsert = 0x9B,
282  KeyHelp = 0x9C,
283  KeyMeta = 0x9D,
284  KeyBackQuote = 0xC0,
285  KeyQuote = 0xDE,
286  KeyFinal = 0x18,
287  KeyConvert = 0x1C,
288  KeyNonConvert = 0x1D,
289  KeyAccept = 0x1E,
290  KeyModeChange = 0x1F,
291  KeyKana = 0x15,
292  KeyKanji = 0x19,
294 };
295 
304 EXPORT_SYM int get_key_state(enum KeyCode key);
305 
310 EXPORT_SYM void get_mouse_position(int *x, int *y);
311 
318 
325 
332 
333 #ifdef __cplusplus
334 }
335 #endif
336 
337 #endif
convert key
Definition: graphics.h:287
multiply key &#39;*&#39;
Definition: graphics.h:259
quote key
Definition: graphics.h:285
back slash key &#39;\&#39;
Definition: graphics.h:247
EXPORT_SYM void graphics_blit_enc(const unsigned char *data, Encoding enc, int x, int y, int width, int height)
F6 key.
Definition: graphics.h:270
equals key &#39;=&#39;
Definition: graphics.h:219
EXPORT_SYM void graphics_circle_fill(int cx, int cy, int radius, int r, int g, int b)
backspace key
Definition: graphics.h:186
F1 key.
Definition: graphics.h:265
EXPORT_SYM int graphics_open(int width, int height)
tab key
Definition: graphics.h:187
F8 key.
Definition: graphics.h:272
Definition: graphics.h:47
EXPORT_SYM void graphics_triangle_fill(int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b)
scroll lock key
Definition: graphics.h:279
q key
Definition: graphics.h:236
close bracket key &#39;]&#39;
Definition: graphics.h:248
EXPORT_SYM void graphics_fill(int r, int g, int b)
numpad 2 key
Definition: graphics.h:251
cancel key
Definition: graphics.h:188
decimal key &#39;.&#39;
Definition: graphics.h:263
p key
Definition: graphics.h:235
zero key
Definition: graphics.h:208
add key &#39;+&#39;
Definition: graphics.h:260
insert key
Definition: graphics.h:281
s key
Definition: graphics.h:238
EXPORT_SYM void graphics_pixel(int x, int y, int r, int g, int b)
f key
Definition: graphics.h:225
shift key
Definition: graphics.h:190
control key
Definition: graphics.h:191
b key
Definition: graphics.h:221
F9 key.
Definition: graphics.h:273
two key
Definition: graphics.h:210
F7 key.
Definition: graphics.h:271
right arrow key
Definition: graphics.h:203
numpad 0 key
Definition: graphics.h:249
k key
Definition: graphics.h:230
backquote key
Definition: graphics.h:284
up arrow key
Definition: graphics.h:202
g key
Definition: graphics.h:226
Encoding
Definition: graphics.h:46
five key
Definition: graphics.h:213
F5 key.
Definition: graphics.h:269
F2 key.
Definition: graphics.h:266
j key
Definition: graphics.h:229
KeyCode
Definition: graphics.h:183
EXPORT_SYM void graphics_line(int x1, int y1, int x2, int y2, int r, int g, int b)
z key
Definition: graphics.h:245
home key
Definition: graphics.h:200
Definition: graphics.h:48
mode change key
Definition: graphics.h:290
clear key
Definition: graphics.h:189
EXPORT_SYM int get_mouse_left_button()
period key &#39;.&#39;
Definition: graphics.h:206
four key
Definition: graphics.h:212
d key
Definition: graphics.h:223
space key
Definition: graphics.h:196
EXPORT_SYM void get_mouse_position(int *x, int *y)
EXPORT_SYM int get_key_state(enum KeyCode key)
numpad 5 key
Definition: graphics.h:254
l key
Definition: graphics.h:231
e key
Definition: graphics.h:224
slash key &#39;/&#39;
Definition: graphics.h:207
F12 key.
Definition: graphics.h:276
six key
Definition: graphics.h:214
semicolon key &#39;;&#39;
Definition: graphics.h:218
enter key
Definition: graphics.h:185
nine key
Definition: graphics.h:217
F10 key.
Definition: graphics.h:274
EXPORT_SYM int get_mouse_middle_button()
c key
Definition: graphics.h:222
undefined key
Definition: graphics.h:293
EXPORT_SYM void graphics_clear()
divide key &#39;/&#39;
Definition: graphics.h:264
numpad 7 key
Definition: graphics.h:256
capslock key
Definition: graphics.h:194
seven key
Definition: graphics.h:215
one key
Definition: graphics.h:209
x key
Definition: graphics.h:243
kanji key
Definition: graphics.h:292
numpad 6 key
Definition: graphics.h:255
numpad 1 key
Definition: graphics.h:250
numlock key
Definition: graphics.h:278
numpad 4 key
Definition: graphics.h:253
left key
Definition: graphics.h:201
final key
Definition: graphics.h:286
w key
Definition: graphics.h:242
F4 key.
Definition: graphics.h:268
down arrow key
Definition: graphics.h:204
i key
Definition: graphics.h:228
#define EXPORT_SYM
Definition: export.h:7
EXPORT_SYM void graphics_blit_region_enc(const unsigned char *data, Encoding enc, int sx, int sy, int ex, int ey, int width, int height, int dx, int dy)
u key
Definition: graphics.h:240
EXPORT_SYM int get_mouse_right_button()
page down key
Definition: graphics.h:198
non convert key
Definition: graphics.h:288
v key
Definition: graphics.h:241
end key
Definition: graphics.h:199
escape key
Definition: graphics.h:195
kana key
Definition: graphics.h:291
page up key
Definition: graphics.h:197
subtract key &#39;-&#39;
Definition: graphics.h:262
EXPORT_SYM void graphics_rectangle(int x1, int y1, int x2, int y2, int r, int g, int b)
three key
Definition: graphics.h:211
F3 key.
Definition: graphics.h:267
pause key
Definition: graphics.h:193
separator key &#39;-&#39;
Definition: graphics.h:261
alt key
Definition: graphics.h:192
EXPORT_SYM void graphics_blit_region(const unsigned char *data, int sx, int sy, int ex, int ey, int width, int height, int dx, int dy)
print screen key
Definition: graphics.h:280
EXPORT_SYM void graphics_update()
meta key
Definition: graphics.h:283
accept key
Definition: graphics.h:289
o key
Definition: graphics.h:234
m key
Definition: graphics.h:232
t key
Definition: graphics.h:239
n key
Definition: graphics.h:233
EXPORT_SYM void graphics_rectangle_fill(int x1, int y1, int x2, int y2, int r, int g, int b)
delete key
Definition: graphics.h:277
EXPORT_SYM void graphics_circle(int cx, int cy, int radius, int r, int g, int b)
EXPORT_SYM void graphics_close()
EXPORT_SYM void graphics_triangle(int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b)
help key
Definition: graphics.h:282
y key
Definition: graphics.h:244
eight key
Definition: graphics.h:216
numpad 9 key
Definition: graphics.h:258
h key
Definition: graphics.h:227
open bracket key &#39;[&#39;
Definition: graphics.h:246
numpad 8 key
Definition: graphics.h:257
numpad 3 key
Definition: graphics.h:252
EXPORT_SYM void graphics_blit(const unsigned char *data, int x, int y, int width, int height)
comma key &#39;,&#39;
Definition: graphics.h:205
a key
Definition: graphics.h:220
F11 key.
Definition: graphics.h:275
r key
Definition: graphics.h:237