eobish

view src/fblib.c @ 5:0baf4e98315e

depth cueing
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 19 Jan 2015 02:32:01 +0200
parents cdbcae5b3b98
children 6a350c554e46
line source
1 #include "fblib.h"
2 #include "fblibimp.h"
4 void fb_set_palette(int *colors)
5 {
6 fb_set_palette_range(0, 256, colors);
7 }
9 void fb_set_palette_entry(int idx, int r, int g, int b)
10 {
11 int col[3];
12 col[0] = r;
13 col[1] = g;
14 col[2] = b;
16 fb_set_palette_range(idx, 1, col);
17 }
19 int fb_key_state(int key)
20 {
21 if(key < 256) {
22 return fb_inp.key[key];
23 }
24 return 0;
25 }
27 int fb_mouse_state(int bn, int *x, int *y)
28 {
29 return 0;
30 }
32 void fb_keyboard_callback(int (*func)(int, int, void*), void *cls)
33 {
34 fb_cb.keyb = func;
35 fb_cb.keyb_data = cls;
36 }
38 void fb_mouse_button_callback(int (*func)(int, int, int, int, void*), void *cls)
39 {
40 fb_cb.button = func;
41 fb_cb.button_data = cls;
42 }
44 void fb_mouse_motion_callback(int (*func)(int, int, void*), void *cls)
45 {
46 fb_cb.motion = func;
47 fb_cb.motion_data = cls;
48 }