clooneljump/src/gamebase.hpp

39 lines
848 B
C++
Raw Normal View History

#ifndef id8C7FE975525B4329BFBEAF364D934EAD
#define id8C7FE975525B4329BFBEAF364D934EAD
#include <memory>
namespace cloonel {
class SDLMain;
class Texture;
class InputBag;
class GameBase {
public:
float Exec ( void );
bool WantsToQuit ( void ) const;
protected:
explicit GameBase ( SDLMain* parSdlMain );
virtual ~GameBase ( void ) noexcept;
virtual void Prepare ( void ) = 0;
virtual void Destroy ( void ) noexcept = 0;
SDLMain* SDLObject ( void ) { return m_sdlmain; }
InputBag* InputBagObject ( void ) { return m_input.get(); }
private:
virtual void OnRender ( void ) = 0;
virtual void OnUpdate ( float parDelta ) = 0;
virtual bool ShouldQuit ( void ) const;
const std::unique_ptr<InputBag> m_input;
SDLMain* const m_sdlmain;
unsigned int m_time0;
bool m_wantsToQuit;
};
} //namespace cloonel
#endif