5 class TestWindow : public BC_Window
8 TestWindow() : BC_Window("test",
22 struct timeval start_time;
23 struct timeval last_time;
29 static void init_status(status_t *status)
31 gettimeofday(&status->start_time, 0);
32 gettimeofday(&status->last_time, 0);
36 static void update_status(status_t *status)
38 struct timeval new_time;
39 gettimeofday(&new_time, 0);
40 if(new_time.tv_sec - status->last_time.tv_sec > 1)
42 fprintf(stderr, "%lld frames. %lld frames/sec \r",
44 (int64_t)status->frames /
45 (int64_t)(new_time.tv_sec - status->start_time.tv_sec));
47 status->last_time = new_time;
51 static void stop_status()
53 fprintf(stderr, "\n\n");
58 int main(int argc, char *argv[])
63 // int result = window.accel_available(BC_YUV422);
64 // printf("accel_available == %d\n", result);
66 BC_Bitmap *bitmap1 = window.new_bitmap(640, 480, BC_BGR8888);
71 window.draw_bitmap(bitmap1, 1);
73 update_status(&status);