Mercurial > hg > Members > kono > Cerium
annotate Renderer/Engine/viewer.h @ 558:b05bae017029
boss1_action
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 22 Oct 2009 18:38:07 +0900 |
parents | 01b64f21405e |
children | a5fda4e51498 |
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" |
507 | 12 |
511 | 13 class Application; |
283 | 14 |
511 | 15 class Viewer : public MainLoop { |
510 | 16 |
283 | 17 public: |
510 | 18 |
283 | 19 Viewer(int bpp, int width, int height, int spenum); |
20 | |
510 | 21 virtual ~Viewer() {} |
283 | 22 |
507 | 23 Application *app; |
24 | |
25 TaskManager *manager; | |
26 key_stat *keyPtr; | |
27 HTaskPtr draw_dummy; | |
28 | |
283 | 29 /* screen info */ |
30 int width; | |
31 int height; | |
32 int bpp; | |
33 | |
34 int spe_num; | |
35 | |
36 int rgb_size[3]; | |
37 Uint32 video_flags; | |
38 Uint32 *pixels; | |
39 | |
558 | 40 SceneGraphRoot *sgroot; |
41 | |
507 | 42 virtual void video_init(TaskManager *manager) = 0; |
283 | 43 void init(); |
44 | |
45 int get_ticks(); | |
46 bool quit_check(); | |
47 void quit(); | |
48 | |
49 virtual void swap_buffers(); | |
50 virtual void clean_pixels() {} | |
51 | |
509
8148c81d2660
Cerium Rendering Library
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
507
diff
changeset
|
52 virtual void run_init(TaskManager *manager, Application *app); |
507 | 53 virtual void run_loop(HTaskPtr task_next); |
54 virtual void run_draw(HTaskPtr task_next); | |
55 virtual void run_finish(); | |
56 virtual void run_move(HTaskPtr task_next); | |
57 virtual void run_collision(); | |
58 virtual void rendering(HTaskPtr task_next); | |
59 virtual void common_draw(HTaskPtr task_next); | |
60 virtual void common_rendering(HTaskPtr task_next); | |
61 | |
62 virtual void spe_rendering(HTaskPtr task_next); | |
63 virtual void spe_draw(HTaskPtr task_next); | |
64 //virtual void exchange_sgroot(TaskManager *manager); | |
65 | |
66 void getKey(); | |
67 void get_send_controll(); | |
511 | 68 |
558 | 69 // void createFromXMLfile(const char *file); |
70 // SceneGraph *createSceneGraph(int id); | |
71 // SceneGraph *createSceneGraph(); | |
72 // void setSceneData(SceneGraph *g); | |
512 | 73 void mainLoop(); |
511 | 74 |
558 | 75 void createFromXMLfile(const char *file) |
76 { | |
77 sgroot->createFromXMLfile(manager, file); | |
78 } | |
79 | |
80 SceneGraph * createSceneGraph(int id) | |
81 { | |
82 return sgroot->createSceneGraph(id); | |
83 } | |
84 | |
85 SceneGraph * createSceneGraph() | |
86 { | |
87 return sgroot->createSceneGraph(); | |
88 } | |
89 | |
90 void setSceneData(SceneGraph *g) | |
91 { | |
92 sgroot->setSceneData(g); | |
93 } | |
94 | |
95 | |
96 | |
507 | 97 private: |
98 HTaskPtr initLoop(); | |
99 void speLoop(); | |
100 | |
283 | 101 }; |
102 | |
507 | 103 #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK |
104 | |
105 | |
283 | 106 #endif |
107 |