eobish
view src/fblib.c @ 8:c0e8bbf96849
merged
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 19 Jan 2015 15:49:36 +0200 |
parents | ce0548d24918 |
children |
line source
1 #include "fblib.h"
2 #include "fblibimp.h"
4 int fb_get_width(void)
5 {
6 return fb_width;
7 }
9 int fb_get_height(void)
10 {
11 return fb_height;
12 }
14 int fb_get_bpp(void)
15 {
16 return fb_bpp;
17 }
19 void fb_set_palette(int *colors)
20 {
21 fb_set_palette_range(0, 256, colors);
22 }
24 void fb_set_palette_entry(int idx, int r, int g, int b)
25 {
26 int col[3];
27 col[0] = r;
28 col[1] = g;
29 col[2] = b;
31 fb_set_palette_range(idx, 1, col);
32 }
34 int fb_key_state(int key)
35 {
36 if(key < 256) {
37 return fb_inp.key[key];
38 }
39 return 0;
40 }
42 int fb_mouse_state(int bn, int *x, int *y)
43 {
44 return 0;
45 }
47 void fb_keyboard_callback(int (*func)(int, int, void*), void *cls)
48 {
49 fb_cb.keyb = func;
50 fb_cb.keyb_data = cls;
51 }
53 void fb_mouse_button_callback(int (*func)(int, int, int, int, void*), void *cls)
54 {
55 fb_cb.button = func;
56 fb_cb.button_data = cls;
57 }
59 void fb_mouse_motion_callback(int (*func)(int, int, void*), void *cls)
60 {
61 fb_cb.motion = func;
62 fb_cb.motion_data = cls;
63 }