eobish

annotate src/fblib.h @ 8:c0e8bbf96849

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