Mercurial > hg > Game > Cerium
annotate Renderer/Engine/viewer.h @ 747:18d31d18a6b2 draft
TaskManager changeset 683, Renderer changeset 746
author | hiroki |
---|---|
date | Mon, 25 Jan 2010 18:01:19 +0900 |
parents | 7761ebf9c62a |
children | 4d83a6a958fd |
rev | line source |
---|---|
283 | 1 #ifndef INCLUDED_VIEWER |
2 #define INCLUDED_VIEWER | |
3 | |
4 #include <SDL.h> | |
5 | |
539 | 6 #include "viewer_types.h" |
7 #include "TaskManager.h" | |
8 #include "KeyStat.h" | |
542 | 9 #include "MainLoop.h" |
539 | 10 #include "Application.h" |
558 | 11 #include "SceneGraphRoot.h" |
747 | 12 #include "ViewerDevice.h" |
539 | 13 |
562 | 14 class SceneGraphRoot; |
15 | |
543 | 16 class Application; |
283 | 17 |
543 | 18 class Viewer : public MainLoop { |
542 | 19 |
283 | 20 public: |
542 | 21 |
747 | 22 Viewer(TaskManager *manager, ViewerDevice *dev, int bpp, int width, int height, int spenum); |
283 | 23 |
542 | 24 virtual ~Viewer() {} |
747 | 25 BASE_NEW_DELETE(Viewer); |
283 | 26 |
747 | 27 ViewerDevice *dev; |
539 | 28 Application *app; |
29 | |
30 TaskManager *manager; | |
31 key_stat *keyPtr; | |
32 HTaskPtr draw_dummy; | |
33 | |
283 | 34 /* screen info */ |
35 int bpp; | |
36 | |
747 | 37 int rgb_size[3]; |
283 | 38 int spe_num; |
747 | 39 int width; |
40 int height; | |
283 | 41 |
747 | 42 //float light_xyz[4] __attribute__((aligned(16))); |
43 float *light_xyz; | |
44 float *light_xyz_stock; | |
45 | |
46 | |
283 | 47 Uint32 video_flags; |
48 Uint32 *pixels; | |
49 | |
558 | 50 SceneGraphRoot *sgroot; |
51 | |
747 | 52 //Uint32 *video_init(TaskManager *manager, int bpp, int width, int height); |
283 | 53 void init(); |
54 | |
55 int get_ticks(); | |
56 bool quit_check(); | |
57 void quit(); | |
747 | 58 HTaskPtr initLoop(); |
283 | 59 |
747 | 60 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); | |
539 | 71 |
747 | 72 void spe_rendering(HTaskPtr task_next); |
73 void spe_draw(HTaskPtr task_next); | |
74 // void exchange_sgroot(TaskManager *manager); | |
539 | 75 |
76 void getKey(); | |
77 void get_send_controll(); | |
543 | 78 |
558 | 79 // void createFromXMLfile(const char *file); |
80 // SceneGraph *createSceneGraph(int id); | |
81 // SceneGraph *createSceneGraph(); | |
82 // void setSceneData(SceneGraph *g); | |
544 | 83 void mainLoop(); |
543 | 84 |
671
7761ebf9c62a
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
85 void createFromXMLmemory(SceneGraph * node, char *data, int len) |
7761ebf9c62a
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
86 { |
7761ebf9c62a
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
87 sgroot->createFromXMLmemory(manager, node, data, len); |
7761ebf9c62a
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
88 } |
7761ebf9c62a
fix several Renderer/Test with (void*)sgroot.
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
589
diff
changeset
|
89 |
558 | 90 void createFromXMLfile(const char *file) |
91 { | |
92 sgroot->createFromXMLfile(manager, file); | |
93 } | |
94 | |
95 SceneGraph * createSceneGraph(int id) | |
96 { | |
97 return sgroot->createSceneGraph(id); | |
98 } | |
99 | |
562 | 100 SceneGraph * createSceneGraph(const char *id) |
101 { | |
102 return sgroot->createSceneGraph(id); | |
103 } | |
104 | |
105 int getSgid(const char *id) | |
106 { | |
107 return sgroot->getSgid(id); | |
108 } | |
109 | |
558 | 110 SceneGraph * createSceneGraph() |
111 { | |
112 return sgroot->createSceneGraph(); | |
113 } | |
114 | |
115 void setSceneData(SceneGraph *g) | |
116 { | |
117 sgroot->setSceneData(g); | |
118 } | |
119 | |
589 | 120 int getLast() |
121 { | |
122 return sgroot->getLast(); | |
123 } | |
124 | |
283 | 125 }; |
126 | |
539 | 127 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK |
128 | |
129 | |
283 | 130 #endif |
131 |