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