game_engine.h

来自「开放源码分布式开发包」· C头文件 代码 · 共 62 行

H
62
字号
// Class automatically generated by Dev-C++ New Class wizard

#ifndef GAME_ENGINE_H
#define GAME_ENGINE_H

//setup Irrlicht definitions
#include <irrlicht.h>

#include "game_stateHandler.h"
#include "game_state.h"

#include "../../Options/ICE_options.h"

class game_EventHandler;

//BASE class
// the main engine structure
class game_Engine : public game_StateHandler  { 
protected:
    game_EventHandler *m_pEventHandler;
    irr::u32 m_time ;         //current time, updated every Run()

public:
		// class constructor
		game_Engine();
		// class destructor
		~game_Engine();

		// 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, bool fullscreen = false, 
					   int colordepth = 16, bool stencilbuffer = false,
                        const wchar_t *text =L"ICE - IrrLicht Common Engine");

  //NO NEED TO OVERLOAD THESE FUNCTIONS:
		//event handler
		bool OnEvent(irr::SEvent event);
		// called in main loop to see if engine is still running
		bool Update();
		// renders the scene (according to the appropriate state)
		void Render();

    //ask to be moved to a new state
        virtual void RequestStateChange(tGAME_STATE newState) = 0;
    
private:
    	void Destroy(); //dont call this directly, call RequestDestroy instead!

};

class game_EventHandler : public irr::IEventReceiver {
    game_Engine* m_pBoss;

protected:
    friend class game_Engine;
    game_EventHandler(game_Engine* boss);
    bool OnEvent(irr::SEvent event) ;
};

#endif // GAME_ENGINE_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?