109
|
1 #ifndef INCLUDED_VIEWER
|
|
2 #define INCLUDED_VIEWER
|
|
3
|
|
4 #include <SDL.h>
|
|
5
|
|
6 #ifndef INCLUDED_VIEWER_TYPES
|
|
7 # include "viewer_types.h"
|
|
8 #endif
|
|
9
|
|
10 class Viewer {
|
|
11 public:
|
|
12 Viewer(int bpp, int width, int height, int spenum);
|
|
13
|
|
14 virtual ~Viewer(void) {}
|
|
15
|
|
16 /* screen info */
|
|
17 int width;
|
|
18 int height;
|
|
19 int bpp;
|
|
20
|
|
21 int spe_num;
|
|
22
|
|
23 int rgb_size[3];
|
|
24 Uint32 video_flags;
|
|
25 Uint32 *pixels;
|
|
26
|
|
27 virtual void video_init(void) = 0;
|
|
28 void init();
|
|
29
|
|
30 int get_ticks();
|
|
31 bool quit_check();
|
|
32 void quit();
|
|
33
|
|
34 virtual void swap_buffers();
|
|
35 virtual void clean_pixels() {}
|
|
36
|
144
|
37 virtual void run_init(char *xml, int sg_number);
|
109
|
38 virtual void run_loop(void);
|
|
39 virtual void run_draw(void);
|
|
40 virtual void run_finish(void);
|
|
41 };
|
|
42
|
|
43 #endif
|
|
44
|
|
45 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK
|