libkipr  1.0.0
graphics.h
Go to the documentation of this file.
1 
8 #ifndef _KIPR_GRAPHICS_GRAPHICS_H_
9 #define _KIPR_GRAPHICS_GRAPHICS_H_
10 
11 #include "kipr/export/export.h"
12 
13 #include "graphics_key_code.h"
14 
15 #ifdef __cplusplus
16 extern "C"
17 {
18 #endif
19 
27 EXPORT_SYM int graphics_open(int width, int height);
28 
34 
41 
47 
52 typedef enum Encoding
53 {
54  RGB,
55  BGR
57 
62 EXPORT_SYM void graphics_blit(const unsigned char *data, int x, int y, int width, int height);
63 
68 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);
69 
81 EXPORT_SYM void graphics_blit_enc(const unsigned char *data, Encoding enc, int x, int y, int width, int height);
82 
98 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);
99 
107 EXPORT_SYM void graphics_fill(int r, int g, int b);
108 
118 EXPORT_SYM void graphics_pixel(int x, int y, int r, int g, int b);
119 
131 EXPORT_SYM void graphics_line(int x1, int y1, int x2, int y2, int r, int g, int b);
132 
143 EXPORT_SYM void graphics_circle(int cx, int cy, int radius, int r, int g, int b);
144 
155 EXPORT_SYM void graphics_circle_fill(int cx, int cy, int radius, int r, int g, int b);
156 
168 EXPORT_SYM void graphics_rectangle(int x1, int y1, int x2, int y2, int r, int g, int b);
169 
181 EXPORT_SYM void graphics_rectangle_fill(int x1, int y1, int x2, int y2, int r, int g, int b);
182 
197 EXPORT_SYM void graphics_triangle(int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b);
198 
213 EXPORT_SYM void graphics_triangle_fill(int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b);
214 
224 
229 EXPORT_SYM void get_mouse_position(int *x, int *y);
230 
237 
244 
251 
252 #ifdef __cplusplus
253 }
254 #endif
255 
256 #endif
#define EXPORT_SYM
Definition: export.h:7
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)
EXPORT_SYM void graphics_blit(const unsigned char *data, int x, int y, int width, int height)
Key codes used in the graphics window.
KeyCode
All Key Codes.
Definition: graphics_key_code.h:17
EXPORT_SYM void graphics_pixel(int x, int y, int r, int g, int b)
EXPORT_SYM int get_mouse_middle_button()
EXPORT_SYM int get_mouse_left_button()
EXPORT_SYM void graphics_circle_fill(int cx, int cy, int radius, int r, int g, int b)
EXPORT_SYM void graphics_close()
EXPORT_SYM void graphics_line(int x1, int y1, int x2, int y2, int r, int g, int b)
EXPORT_SYM void graphics_fill(int r, int g, int b)
EXPORT_SYM void graphics_circle(int cx, int cy, int radius, int r, int g, int b)
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)
EXPORT_SYM void graphics_triangle(int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b)
EXPORT_SYM void graphics_triangle_fill(int x1, int y1, int x2, int y2, int x3, int y3, int r, int g, int b)
EXPORT_SYM int get_key_state(enum KeyCode key)
EXPORT_SYM void graphics_clear()
EXPORT_SYM void graphics_update()
EXPORT_SYM int get_mouse_right_button()
EXPORT_SYM int graphics_open(int width, int height)
EXPORT_SYM void get_mouse_position(int *x, int *y)
EXPORT_SYM void graphics_rectangle(int x1, int y1, int x2, int y2, int r, int g, int b)
EXPORT_SYM void graphics_blit_enc(const unsigned char *data, Encoding enc, int x, int y, int width, int height)
Encoding
An enumerate with encoding types RGB and BGR.
Definition: graphics.h:53
EXPORT_SYM void graphics_rectangle_fill(int x1, int y1, int x2, int y2, int r, int g, int b)
@ RGB
the enum used to represent RGB encoding
Definition: graphics.h:54
@ BGR
the enum used to represent BGR encoding
Definition: graphics.h:55