Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/viewer.h @ 728:4f77768d7a7f
add Engine/ViewerDevice , SgRootChange not work
author | aaa |
---|---|
date | Sat, 19 Dec 2009 20:32:02 +0900 |
parents | 9136cf9186b6 |
children | 50220f219341 |
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" |
728 | 12 #include "ViewerDevice.h" |
507 | 13 |
562 | 14 class SceneGraphRoot; |
15 | |
511 | 16 class Application; |
283 | 17 |
511 | 18 class Viewer : public MainLoop { |
510 | 19 |
283 | 20 public: |
510 | 21 |
728 | 22 Viewer(TaskManager *manager, ViewerDevice *dev, int bpp, int width, int height, int spenum); |
283 | 23 |
510 | 24 virtual ~Viewer() {} |
283 | 25 |
728 | 26 ViewerDevice *dev; |
507 | 27 Application *app; |
28 | |
29 TaskManager *manager; | |
30 key_stat *keyPtr; | |
31 HTaskPtr draw_dummy; | |
32 | |
283 | 33 /* screen info */ |
34 int width; | |
35 int height; | |
36 int bpp; | |
37 | |
38 int spe_num; | |
39 | |
40 int rgb_size[3]; | |
678
e201be3f6897
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
671
diff
changeset
|
41 float light_xyz[4]; |
e201be3f6897
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
671
diff
changeset
|
42 float *light_xyz_stock; |
e201be3f6897
add Load light info for some spe
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
671
diff
changeset
|
43 |
283 | 44 Uint32 video_flags; |
45 Uint32 *pixels; | |
46 | |
558 | 47 SceneGraphRoot *sgroot; |
48 | |
728 | 49 //Uint32 *video_init(TaskManager *manager, int bpp, int width, int height); |
283 | 50 void init(); |
51 | |
52 int get_ticks(); | |
53 bool quit_check(); | |
54 void quit(); | |
728 | 55 HTaskPtr initLoop(); |
283 | 56 |
728 | 57 void clean_pixels() {} |
58 | |
59 void run_init(TaskManager *manager, Application *app); | |
60 void run_loop(HTaskPtr task_next); | |
61 void run_draw(HTaskPtr task_next); | |
62 void run_finish(); | |
63 void run_move(HTaskPtr task_next); | |
64 void run_collision(); | |
65 void rendering(HTaskPtr task_next); | |
66 void common_draw(HTaskPtr task_next); | |
67 void common_rendering(HTaskPtr task_next, SceneGraphRoot *sgroot); | |
507 | 68 |
728 | 69 void spe_rendering(HTaskPtr task_next); |
70 void spe_draw(HTaskPtr task_next); | |
71 // void exchange_sgroot(TaskManager *manager); | |
507 | 72 |
73 void getKey(); | |
74 void get_send_controll(); | |
511 | 75 |
558 | 76 // void createFromXMLfile(const char *file); |
77 // SceneGraph *createSceneGraph(int id); | |
78 // SceneGraph *createSceneGraph(); | |
79 // void setSceneData(SceneGraph *g); | |
512 | 80 void mainLoop(); |
511 | 81 |
671
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
82 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
|
83 { |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
84 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
|
85 } |
f42b303044f7
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
86 |
558 | 87 void createFromXMLfile(const char *file) |
88 { | |
89 sgroot->createFromXMLfile(manager, file); | |
90 } | |
91 | |
92 SceneGraph * createSceneGraph(int id) | |
93 { | |
94 return sgroot->createSceneGraph(id); | |
95 } | |
96 | |
562 | 97 SceneGraph * createSceneGraph(const char *id) |
98 { | |
99 return sgroot->createSceneGraph(id); | |
100 } | |
101 | |
102 int getSgid(const char *id) | |
103 { | |
104 return sgroot->getSgid(id); | |
105 } | |
106 | |
558 | 107 SceneGraph * createSceneGraph() |
108 { | |
109 return sgroot->createSceneGraph(); | |
110 } | |
111 | |
112 void setSceneData(SceneGraph *g) | |
113 { | |
114 sgroot->setSceneData(g); | |
115 } | |
116 | |
589 | 117 int getLast() |
118 { | |
119 return sgroot->getLast(); | |
120 } | |
121 | |
283 | 122 }; |
123 | |
507 | 124 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK |
125 | |
126 | |
283 | 127 #endif |
128 |