eobish
annotate 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 |
rev | line source |
---|---|
nuclear@2 | 1 #include "fblib.h" |
nuclear@2 | 2 #include "fblibimp.h" |
nuclear@2 | 3 |
nuclear@7 | 4 int fb_get_width(void) |
nuclear@7 | 5 { |
nuclear@7 | 6 return fb_width; |
nuclear@7 | 7 } |
nuclear@7 | 8 |
nuclear@7 | 9 int fb_get_height(void) |
nuclear@7 | 10 { |
nuclear@7 | 11 return fb_height; |
nuclear@7 | 12 } |
nuclear@7 | 13 |
nuclear@7 | 14 int fb_get_bpp(void) |
nuclear@7 | 15 { |
nuclear@7 | 16 return fb_bpp; |
nuclear@7 | 17 } |
nuclear@7 | 18 |
nuclear@2 | 19 void fb_set_palette(int *colors) |
nuclear@2 | 20 { |
nuclear@2 | 21 fb_set_palette_range(0, 256, colors); |
nuclear@2 | 22 } |
nuclear@2 | 23 |
nuclear@2 | 24 void fb_set_palette_entry(int idx, int r, int g, int b) |
nuclear@2 | 25 { |
nuclear@2 | 26 int col[3]; |
nuclear@2 | 27 col[0] = r; |
nuclear@2 | 28 col[1] = g; |
nuclear@2 | 29 col[2] = b; |
nuclear@2 | 30 |
nuclear@2 | 31 fb_set_palette_range(idx, 1, col); |
nuclear@2 | 32 } |
nuclear@2 | 33 |
nuclear@2 | 34 int fb_key_state(int key) |
nuclear@2 | 35 { |
nuclear@2 | 36 if(key < 256) { |
nuclear@2 | 37 return fb_inp.key[key]; |
nuclear@2 | 38 } |
nuclear@2 | 39 return 0; |
nuclear@2 | 40 } |
nuclear@2 | 41 |
nuclear@2 | 42 int fb_mouse_state(int bn, int *x, int *y) |
nuclear@2 | 43 { |
nuclear@2 | 44 return 0; |
nuclear@2 | 45 } |
nuclear@2 | 46 |
nuclear@4 | 47 void fb_keyboard_callback(int (*func)(int, int, void*), void *cls) |
nuclear@2 | 48 { |
nuclear@2 | 49 fb_cb.keyb = func; |
nuclear@2 | 50 fb_cb.keyb_data = cls; |
nuclear@2 | 51 } |
nuclear@2 | 52 |
nuclear@4 | 53 void fb_mouse_button_callback(int (*func)(int, int, int, int, void*), void *cls) |
nuclear@2 | 54 { |
nuclear@2 | 55 fb_cb.button = func; |
nuclear@2 | 56 fb_cb.button_data = cls; |
nuclear@2 | 57 } |
nuclear@2 | 58 |
nuclear@4 | 59 void fb_mouse_motion_callback(int (*func)(int, int, void*), void *cls) |
nuclear@2 | 60 { |
nuclear@2 | 61 fb_cb.motion = func; |
nuclear@2 | 62 fb_cb.motion_data = cls; |
nuclear@2 | 63 } |