Mercurial > hg > Members > kono > Cerium
comparison Renderer/Engine/viewer.h @ 748:b7376415fa5f
TaskManager changeset 683, Renderer changeset 746
author | hiroki |
---|---|
date | Mon, 25 Jan 2010 18:01:19 +0900 |
parents | f42b303044f7 |
children | 4455e7b0caf3 |
comparison
equal
deleted
inserted
replaced
677:fd3492a767c7 | 748:b7376415fa5f |
---|---|
7 #include "TaskManager.h" | 7 #include "TaskManager.h" |
8 #include "KeyStat.h" | 8 #include "KeyStat.h" |
9 #include "MainLoop.h" | 9 #include "MainLoop.h" |
10 #include "Application.h" | 10 #include "Application.h" |
11 #include "SceneGraphRoot.h" | 11 #include "SceneGraphRoot.h" |
12 #include "ViewerDevice.h" | |
12 | 13 |
13 class SceneGraphRoot; | 14 class SceneGraphRoot; |
14 | 15 |
15 class Application; | 16 class Application; |
16 | 17 |
17 class Viewer : public MainLoop { | 18 class Viewer : public MainLoop { |
18 | 19 |
19 public: | 20 public: |
20 | 21 |
21 Viewer(int bpp, int width, int height, int spenum); | 22 Viewer(TaskManager *manager, ViewerDevice *dev, int bpp, int width, int height, int spenum); |
22 | 23 |
23 virtual ~Viewer() {} | 24 virtual ~Viewer() {} |
25 BASE_NEW_DELETE(Viewer); | |
24 | 26 |
27 ViewerDevice *dev; | |
25 Application *app; | 28 Application *app; |
26 | 29 |
27 TaskManager *manager; | 30 TaskManager *manager; |
28 key_stat *keyPtr; | 31 key_stat *keyPtr; |
29 HTaskPtr draw_dummy; | 32 HTaskPtr draw_dummy; |
30 | 33 |
31 /* screen info */ | 34 /* screen info */ |
35 int bpp; | |
36 | |
37 int rgb_size[3]; | |
38 int spe_num; | |
32 int width; | 39 int width; |
33 int height; | 40 int height; |
34 int bpp; | |
35 | 41 |
36 int spe_num; | 42 //float light_xyz[4] __attribute__((aligned(16))); |
43 float *light_xyz; | |
44 float *light_xyz_stock; | |
37 | 45 |
38 int rgb_size[3]; | 46 |
39 Uint32 video_flags; | 47 Uint32 video_flags; |
40 Uint32 *pixels; | 48 Uint32 *pixels; |
41 | 49 |
42 SceneGraphRoot *sgroot; | 50 SceneGraphRoot *sgroot; |
43 | 51 |
44 virtual void video_init(TaskManager *manager) = 0; | 52 //Uint32 *video_init(TaskManager *manager, int bpp, int width, int height); |
45 void init(); | 53 void init(); |
46 | 54 |
47 int get_ticks(); | 55 int get_ticks(); |
48 bool quit_check(); | 56 bool quit_check(); |
49 void quit(); | 57 void quit(); |
58 HTaskPtr initLoop(); | |
50 | 59 |
51 virtual void swap_buffers(); | 60 void clean_pixels() {} |
52 virtual void clean_pixels() {} | 61 |
62 void run_init(TaskManager *manager, Application *app); | |
63 void run_loop(HTaskPtr task_next); | |
64 void run_draw(HTaskPtr task_next); | |
65 void run_finish(); | |
66 void run_move(HTaskPtr task_next); | |
67 void run_collision(); | |
68 void rendering(HTaskPtr task_next); | |
69 void common_draw(HTaskPtr task_next); | |
70 void common_rendering(HTaskPtr task_next, SceneGraphRoot *sgroot); | |
53 | 71 |
54 virtual void run_init(TaskManager *manager, Application *app); | 72 void spe_rendering(HTaskPtr task_next); |
55 virtual void run_loop(HTaskPtr task_next); | 73 void spe_draw(HTaskPtr task_next); |
56 virtual void run_draw(HTaskPtr task_next); | 74 // void exchange_sgroot(TaskManager *manager); |
57 virtual void run_finish(); | |
58 virtual void run_move(HTaskPtr task_next); | |
59 virtual void run_collision(); | |
60 virtual void rendering(HTaskPtr task_next); | |
61 virtual void common_draw(HTaskPtr task_next); | |
62 virtual void common_rendering(HTaskPtr task_next); | |
63 | |
64 virtual void spe_rendering(HTaskPtr task_next); | |
65 virtual void spe_draw(HTaskPtr task_next); | |
66 //virtual void exchange_sgroot(TaskManager *manager); | |
67 | 75 |
68 void getKey(); | 76 void getKey(); |
69 void get_send_controll(); | 77 void get_send_controll(); |
70 | 78 |
71 // void createFromXMLfile(const char *file); | 79 // void createFromXMLfile(const char *file); |
112 int getLast() | 120 int getLast() |
113 { | 121 { |
114 return sgroot->getLast(); | 122 return sgroot->getLast(); |
115 } | 123 } |
116 | 124 |
117 | |
118 | |
119 | |
120 private: | |
121 HTaskPtr initLoop(); | |
122 void speLoop(); | |
123 | |
124 }; | 125 }; |
125 | 126 |
126 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK | 127 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK |
127 | 128 |
128 | 129 |