eobish

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