www.pudn.com > ICE_1.4.zip > game_tetris.h
// Class automatically generated by Dev-C++ New Class wizard #ifndef GAME_TETRIS_H #define GAME_TETRIS_H #include "../defines.h" //setup Irrlicht definitions #include#include "Base_Classes/game_stateHandler.h" #include "Base_Classes/game_state.h" #include "gs_Intro.h" #include "gs_OptionMenu.h" #include "gs_Main.h" #include "../Options/ICE_options.h" // contains game state and handles user input class game_tetris : public irr::IEventReceiver, game_StateHandler { tGAME_STATE m_GameState; //enum of the current state game_State *m_pCurrState; //pointer to the current state bool destroyMe; //set by requestDestroy, will call Destroy() if true irr::u32 m_time ; //current time (not currently used) public: game_tetris(); ~game_tetris(); // called to start up the irrlicht engine and set up game variables bool Init(irr::video::EDriverType device_type = irr::video::EDT_OPENGL, int res_x = 640, int res_y = 480); // renders the scene (according to the appropriate state) void Render(); // called in main loop to see if engine is still running bool Update(); // event hanlder virtual bool OnEvent(irr::SEvent event); //passively tell game to quit (will be handled next loop) void RequestDestroy() { destroyMe = true; } //ask to be moved to a new state void RequestStateChange(tGAME_STATE newState); private: void Destroy(); //dont call this directly, call RequestDestroy instead! }; #endif // GAME_TETRIS_H