8 /*extern int fb_width, fb_height, fb_bpp;*/
11 #define FB_ASPECT ((float)FB_WIDTH / (float)FB_HEIGHT)
13 extern uint16_t *fb_pixels;
14 extern uint16_t *vmem;
16 extern unsigned long time_msec;
17 extern int mouse_x, mouse_y;
18 extern unsigned int mouse_bmask;
32 KB_NUM_0, KB_NUM_1, KB_NUM_2, KB_NUM_3, KB_NUM_4,
33 KB_NUM_5, KB_NUM_6, KB_NUM_7, KB_NUM_8, KB_NUM_9,
34 KB_NUM_DOT, KB_NUM_DIV, KB_NUM_MUL, KB_NUM_MINUS, KB_NUM_PLUS, KB_NUM_ENTER, KB_NUM_EQUALS,
35 KB_UP, KB_DOWN, KB_RIGHT, KB_LEFT,
36 KB_INSERT, KB_HOME, KB_END, KB_PGUP, KB_PGDN,
37 KB_F1, KB_F2, KB_F3, KB_F4, KB_F5, KB_F6,
38 KB_F7, KB_F8, KB_F9, KB_F10, KB_F11, KB_F12,
39 KB_F13, KB_F14, KB_F15,
40 KB_NUMLK, KB_CAPSLK, KB_SCRLK,
41 KB_RSHIFT, KB_LSHIFT, KB_RCTRL, KB_LCTRL, KB_RALT, KB_LALT,
42 KB_RMETA, KB_LMETA, KB_LSUPER, KB_RSUPER, KB_MODE, KB_COMPOSE,
43 KB_HELP, KB_PRINT, KB_SYSRQ, KB_BREAK
54 extern float sball_matrix[16];
56 int demo_init(int argc, char **argv);
57 int demo_init1(int argc, char **argv);
59 void demo_cleanup(void);
61 int demo_resizefb(int width, int height, int bpp);
64 void demo_post_draw(void *pixels);
66 void demo_keyboard(int key, int press);
69 /* defined in main_*.c */
71 void demo_abort(void);
72 unsigned long get_msec(void);
73 void set_palette(int idx, int r, int g, int b);
75 #define swap_buffers(pix) blit_frame(pix ? pix : fb_pixels, opt.vsync)
77 void change_screen(int idx);
79 /* call each frame to get 3D viewing spherical coordinates */
80 void mouse_orbit_update(float *theta, float *phi, float *dist);
82 void draw_mouse_pointer(uint16_t *fb);
84 /* compiled sprites available */
85 typedef void (*cs_font_func)(void *, int, int, int);
86 void cs_dbgfont(void *fb, int x, int y, int idx);
87 void cs_confont(void *fb, int x, int y, int idx);
89 /* helper to print text with cs_font */
90 void cs_puts_font(cs_font_func csfont, int sz, void *fb, int x, int y, const char *str);
92 #define cs_dputs(fb, x, y, str) cs_puts_font(cs_dbgfont, 9, fb, x, y, str)
93 #define cs_cputs(fb, x, y, str) cs_puts_font(cs_confont, 6, fb, x, y, str)
95 #define cs_mouseptr(fb, x, y) cs_dbgfont(fb, x, y, 127 - ' ')