X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fdemo.h;h=a3cc66a2d9b1c2e372f0732ae88b86ff715bb55d;hp=60c7646ff8449bc8edf50676907de75528c1b881;hb=73f97e0d9dc83cad4aa7b53d900ea28390afed4f;hpb=6c5e65928b425dd6a7f5192841e1d4ef9d90789a diff --git a/src/demo.h b/src/demo.h index 60c7646..a3cc66a 100644 --- a/src/demo.h +++ b/src/demo.h @@ -5,14 +5,18 @@ extern int fb_width, fb_height, fb_bpp; extern uint16_t *fb_pixels; /* system-RAM pixel buffer: use swap_buffers(fb_pixels) */ -/* video memory pointers. might both point to the front buffer if there is not - * enough memory for page flipping. use swap_buffers(0) to flip. */ -extern uint16_t *vmem_back, *vmem_front; +extern uint16_t *vmem; /* visible video memory pointer */ extern unsigned long time_msec; extern int mouse_x, mouse_y; extern unsigned int mouse_bmask; +enum { + MOUSE_BN_LEFT = 1, + MOUSE_BN_RIGHT = 2, + MOUSE_BN_MIDDLE = 4 +}; + extern float sball_matrix[16]; int demo_init(int argc, char **argv); @@ -20,7 +24,7 @@ void demo_cleanup(void); void demo_draw(void); -void demo_keyboard(int key, int state); +void demo_keyboard(int key, int press); /* defined in main_*.c */ @@ -28,10 +32,18 @@ void demo_quit(void); unsigned long get_msec(void); void set_palette(int idx, int r, int g, int b); -/* pass 0 to just swap vmem_back/vmem_front with page flipping - * pass a pointer to a system-ram pixel buffer to copy it to vmem_front, - * instead of flipping. - */ +/* if pixels is 0, it defaults to fb_pixels */ void swap_buffers(void *pixels); +/* call each frame to get 3D viewing spherical coordinates */ +void mouse_orbit_update(float *theta, float *phi, float *dist); + +void draw_mouse_pointer(uint16_t *fb); + +/* compiled sprites available */ +void cs_font(void *fb, int x, int y, int idx); + +/* helper to print text with cs_font */ +void cs_puts(void *fb, int x, int y, const char *str); + #endif /* DEMO_H_ */