26
|
1 #include <SDL.h>
|
|
2
|
|
3 #ifndef INCLUDED_VIEWER
|
|
4 #define INCLUDED_VIEWER
|
|
5
|
109
|
6 #ifndef INCLUDED_VIEWER_TYPES
|
|
7 # include "viewer_types.h"
|
|
8 #endif
|
|
9
|
26
|
10 #include "TaskManager.h"
|
|
11
|
|
12 extern TaskManager *manager;
|
|
13
|
|
14 class Viewer{
|
|
15 public:
|
|
16
|
109
|
17 static int width;
|
|
18 static int height;
|
|
19 static int bpp;
|
|
20 static int spe_num;
|
|
21 int rgb_size[3];
|
|
22 Uint32 video_flags;
|
|
23 SDL_Surface *screen;
|
|
24 Uint32 *pixels;
|
|
25 //float zRow[1920][1080];
|
|
26 float zRow[MAX_WIDTH][MAX_HEIGHT];
|
26
|
27
|
109
|
28 Viewer(int b=32, int w=640, int h=480);
|
|
29 Viewer(int b=32, int w=640, int h=480, int spenum = 1);
|
|
30 void sdl_init();
|
|
31 void init();
|
|
32 int get_ticks();
|
|
33 bool quit_check();
|
|
34 void quit();
|
|
35 void screen_clear();
|
|
36 void swap_buffers();
|
|
37 void write_pixel(int x, int y,float z, Uint32 rgb);
|
|
38 void write_line(float x1, float y1, float x2, float y2, Uint32 rgb);
|
|
39 void write_triangle(float x1, float y1, float x2, float y2, float x3, float y3, Uint32 rgb);
|
|
40 void clean_pixels();
|
|
41 void graph_line();
|
49
|
42
|
109
|
43 //void run();
|
|
44 void run_init(char *xml);
|
|
45 void run_loop();
|
|
46 void run_finish();
|
|
47 void run_draw();
|
48
|
48
|
109
|
49 void zRow_init();
|
26
|
50 };
|
|
51
|
|
52 #endif
|