4 * Copyright (C) 2008 Adam Williams <broadcast at earthling dot net>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 class TestWindow : public BC_Window
29 TestWindow() : BC_Window("test",
43 struct timeval start_time;
44 struct timeval last_time;
50 static void init_status(status_t *status)
52 gettimeofday(&status->start_time, 0);
53 gettimeofday(&status->last_time, 0);
57 static void update_status(status_t *status)
59 struct timeval new_time;
60 gettimeofday(&new_time, 0);
61 if(new_time.tv_sec - status->last_time.tv_sec > 1)
63 fprintf(stderr, "%lld frames. %lld frames/sec \r",
65 (int64_t)status->frames /
66 (int64_t)(new_time.tv_sec - status->start_time.tv_sec));
68 status->last_time = new_time;
72 static void stop_status()
74 fprintf(stderr, "\n\n");
79 int main(int argc, char *argv[])
84 // int result = window.accel_available(BC_YUV422);
85 // printf("accel_available == %d\n", result);
87 BC_Bitmap *bitmap1 = window.new_bitmap(640, 480, BC_BGR8888);
92 window.draw_bitmap(bitmap1, 1);
94 update_status(&status);