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