Mercurial > hg > Members > kono > Cerium
view Renderer/Engine/viewer.h @ 576:cc989924f469
minor fix
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 23 Oct 2009 17:02:47 +0900 |
parents | a5fda4e51498 |
children | f674ca0fb76d |
line wrap: on
line source
#ifndef INCLUDED_VIEWER #define INCLUDED_VIEWER #include <SDL.h> #include "viewer_types.h" #include "TaskManager.h" #include "KeyStat.h" #include "MainLoop.h" #include "Application.h" #include "SceneGraphRoot.h" class SceneGraphRoot; class Application; class Viewer : public MainLoop { public: Viewer(int bpp, int width, int height, int spenum); virtual ~Viewer() {} Application *app; TaskManager *manager; key_stat *keyPtr; HTaskPtr draw_dummy; /* screen info */ int width; int height; int bpp; int spe_num; int rgb_size[3]; Uint32 video_flags; Uint32 *pixels; SceneGraphRoot *sgroot; virtual void video_init(TaskManager *manager) = 0; void init(); int get_ticks(); bool quit_check(); void quit(); virtual void swap_buffers(); virtual void clean_pixels() {} virtual void run_init(TaskManager *manager, Application *app); virtual void run_loop(HTaskPtr task_next); virtual void run_draw(HTaskPtr task_next); virtual void run_finish(); virtual void run_move(HTaskPtr task_next); virtual void run_collision(); virtual void rendering(HTaskPtr task_next); virtual void common_draw(HTaskPtr task_next); virtual void common_rendering(HTaskPtr task_next); virtual void spe_rendering(HTaskPtr task_next); virtual void spe_draw(HTaskPtr task_next); //virtual void exchange_sgroot(TaskManager *manager); void getKey(); void get_send_controll(); // void createFromXMLfile(const char *file); // SceneGraph *createSceneGraph(int id); // SceneGraph *createSceneGraph(); // void setSceneData(SceneGraph *g); void mainLoop(); void createFromXMLfile(const char *file) { sgroot->createFromXMLfile(manager, file); } SceneGraph * createSceneGraph(int id) { return sgroot->createSceneGraph(id); } SceneGraph * createSceneGraph(const char *id) { return sgroot->createSceneGraph(id); } int getSgid(const char *id) { return sgroot->getSgid(id); } SceneGraph * createSceneGraph() { return sgroot->createSceneGraph(); } void setSceneData(SceneGraph *g) { sgroot->setSceneData(g); } private: HTaskPtr initLoop(); void speLoop(); }; #define default_sdl_flag SDL_INIT_TIMER | SDL_INIT_JOYSTICK #endif