Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/viewer.h @ 925:9da903858400
add profile in Redering Engine
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 30 Jul 2010 16:57:17 +0900 |
parents | 655e11f6e437 |
children | 4e6030ddde45 |
rev | line source |
---|---|
283 | 1 #ifndef INCLUDED_VIEWER |
2 #define INCLUDED_VIEWER | |
3 | |
4 #include <SDL.h> | |
5 | |
507 | 6 #include "viewer_types.h" |
7 #include "TaskManager.h" | |
8 #include "KeyStat.h" | |
510 | 9 #include "MainLoop.h" |
507 | 10 #include "Application.h" |
558 | 11 #include "SceneGraphRoot.h" |
748 | 12 #include "ViewerDevice.h" |
909 | 13 #include "matrix.h" |
507 | 14 |
562 | 15 class SceneGraphRoot; |
16 | |
511 | 17 class Application; |
283 | 18 |
511 | 19 class Viewer : public MainLoop { |
510 | 20 |
283 | 21 public: |
925
9da903858400
add profile in Redering Engine
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
922
diff
changeset
|
22 Viewer(){ profile = 0;}; |
748 | 23 Viewer(TaskManager *manager, ViewerDevice *dev, int bpp, int width, int height, int spenum); |
283 | 24 |
510 | 25 virtual ~Viewer() {} |
748 | 26 BASE_NEW_DELETE(Viewer); |
283 | 27 |
748 | 28 ViewerDevice *dev; |
507 | 29 Application *app; |
30 | |
31 TaskManager *manager; | |
32 key_stat *keyPtr; | |
33 HTaskPtr draw_dummy; | |
34 | |
283 | 35 /* screen info */ |
36 int bpp; | |
37 | |
748 | 38 int rgb_size[3]; |
283 | 39 int spe_num; |
748 | 40 int width; |
41 int height; | |
283 | 42 |
748 | 43 float *light_xyz; |
44 float *light_xyz_stock; | |
792 | 45 int *light_switch; |
46 int *light_switch_stock; | |
793 | 47 int *light_sysswitch; |
48 int light_sysswitch_stock; | |
748 | 49 |
283 | 50 Uint32 video_flags; |
51 Uint32 *pixels; | |
52 | |
914 | 53 int mem_flag; |
925
9da903858400
add profile in Redering Engine
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
922
diff
changeset
|
54 int profile; |
914 | 55 |
558 | 56 SceneGraphRoot *sgroot; |
57 | |
748 | 58 //Uint32 *video_init(TaskManager *manager, int bpp, int width, int height); |
283 | 59 void init(); |
60 | |
61 int get_ticks(); | |
62 bool quit_check(); | |
63 void quit(); | |
748 | 64 HTaskPtr initLoop(); |
283 | 65 |
748 | 66 void clean_pixels() {} |
869 | 67 |
922 | 68 virtual void run_init(TaskManager *manager, Application *app); |
748 | 69 void run_loop(HTaskPtr task_next); |
70 void run_draw(HTaskPtr task_next); | |
71 void run_finish(); | |
72 void run_move(HTaskPtr task_next); | |
73 void run_collision(); | |
74 void rendering(HTaskPtr task_next); | |
75 void common_draw(HTaskPtr task_next); | |
76 void common_rendering(HTaskPtr task_next, SceneGraphRoot *sgroot); | |
507 | 77 |
748 | 78 void spe_rendering(HTaskPtr task_next); |
79 void spe_draw(HTaskPtr task_next); | |
80 // void exchange_sgroot(TaskManager *manager); | |
507 | 81 |
792 | 82 HTaskPtr update_task_create(void *data, int size, |
83 int load_id, int spe_id, HTaskPtr wait); | |
84 | |
507 | 85 void getKey(); |
86 void get_send_controll(); | |
511 | 87 |
558 | 88 // void createFromXMLfile(const char *file); |
89 // SceneGraph *createSceneGraph(int id); | |
90 // SceneGraph *createSceneGraph(); | |
91 // void setSceneData(SceneGraph *g); | |
512 | 92 void mainLoop(); |
511 | 93 |
886 | 94 void set_move_task(SceneGraphPtr node, int move_id, void *titlep, int size, PostFunction post_func) |
95 { | |
96 sgroot->set_move_task(node, move_id, titlep, size, post_func); | |
97 } | |
869 | 98 void set_game_task(int id, void *property, int size, PostFunction post_func) |
99 { | |
100 sgroot->set_game_task(id, property, size, post_func); | |
101 } | |
102 | |
671
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
103 void createFromXMLmemory(SceneGraph * node, char *data, int len) |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
104 { |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
105 sgroot->createFromXMLmemory(manager, node, data, len); |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
106 } |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
107 |
558 | 108 void createFromXMLfile(const char *file) |
109 { | |
110 sgroot->createFromXMLfile(manager, file); | |
111 } | |
112 | |
113 SceneGraph * createSceneGraph(int id) | |
114 { | |
115 return sgroot->createSceneGraph(id); | |
116 } | |
117 | |
562 | 118 SceneGraph * createSceneGraph(const char *id) |
119 { | |
120 return sgroot->createSceneGraph(id); | |
121 } | |
122 | |
123 int getSgid(const char *id) | |
124 { | |
125 return sgroot->getSgid(id); | |
126 } | |
127 | |
558 | 128 SceneGraph * createSceneGraph() |
129 { | |
130 return sgroot->createSceneGraph(); | |
131 } | |
132 | |
133 void setSceneData(SceneGraph *g) | |
134 { | |
135 sgroot->setSceneData(g); | |
136 } | |
137 | |
589 | 138 int getLast() |
139 { | |
140 return sgroot->getLast(); | |
141 } | |
142 | |
793 | 143 SceneGraphPtr getLight(int id) |
144 { | |
145 return sgroot->getLight(id); | |
146 } | |
147 | |
148 void OnLightSwitch(int id) | |
149 { | |
150 sgroot->OnLightSwitch(id); | |
151 } | |
152 | |
153 void OffLightSwitch(int id) | |
154 { | |
155 sgroot->OffLightSwitch(id); | |
156 } | |
157 | |
158 void OnLightSysSwitch() | |
159 { | |
160 sgroot->OnLightSysSwitch(); | |
161 } | |
162 | |
163 void OffLightSysSwitch() | |
164 { | |
165 sgroot->OffLightSysSwitch(); | |
166 } | |
167 | |
283 | 168 }; |
169 | |
507 | 170 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK |
171 | |
172 | |
283 | 173 #endif |
174 |