14 int main(int argc, char **argv)
17 long fbsize = fb_width * fb_height * fb_bpp / CHAR_BIT;
22 if((use_mouse = have_mouse())) {
23 set_mouse_limits(0, 0, fb_width, fb_height);
24 set_mouse(fb_width / 2, fb_height / 2);
27 if(!(fb_pixels = malloc(fbsize))) {
28 fprintf(stderr, "failed to allocate backbuffer\n");
32 if(!(vmem = set_video_mode(fb_width, fb_height, fb_bpp))) {
36 if(demo_init(argc, argv) == -1) {
44 while((key = kb_getkey()) != -1) {
45 demo_keyboard(key, 1);
47 if(quit) goto break_evloop;
50 mouse_bmask = read_mouse(&mouse_x, &mouse_y);
53 time_msec = get_msec();
57 memcpy(vmem, fb_pixels, fbsize);