eobish

view src/fblib.h @ 4:ce0548d24918

mostly works
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 18 Jan 2015 13:30:30 +0200
parents cdbcae5b3b98
children
line source
1 #ifndef FBLIB_H_
2 #define FBLIB_H_
4 #ifdef __cplusplus
5 extern "C" {
6 #endif
8 /* pixel formats for various bpp values
9 * 32: [R8][G8][B8][X8] or [X|B|G|R] (little endian)
10 * 24: [R8][G8][B8]
11 * 16: [R5|G6|B5]
12 * 15: [R5|G5|B5]
13 * 8: [I8] (8 bit color index)
14 */
15 int fb_init(int width, int height, int bpp);
16 void fb_shutdown(void);
18 int fb_get_width(void);
19 int fb_get_height(void);
20 int fb_get_bpp(void);
22 void *fb_begin_frame(void);
23 void fb_end_frame(void);
25 void fb_set_palette(int *colors);
26 void fb_set_palette_range(int start, int count, int *colors);
27 void fb_set_palette_entry(int idx, int r, int g, int b);
29 /* event handling */
30 int fb_key_state(int key);
31 int fb_mouse_state(int bn, int *x, int *y);
33 void fb_keyboard_callback(int (*func)(int, int, void*), void *cls);
34 void fb_mouse_button_callback(int (*func)(int, int, int, int, void*), void *cls);
35 void fb_mouse_motion_callback(int (*func)(int, int, void*), void *cls);
37 int fb_process_events(void);
39 /* misc */
40 unsigned long fb_get_time(void);
42 #ifdef __cplusplus
43 }
44 #endif
47 #endif /* FBLIB_H_ */