User can quit manually.
The program doesn't run for a fixed time anymore. Instead it listens to events and user can quit by closing the window.
This commit is contained in:
parent
fb92097419
commit
93a7796c5a
3 changed files with 37 additions and 2 deletions
|
@ -10,6 +10,7 @@ namespace cloonel {
|
|||
class GameBase {
|
||||
public:
|
||||
float Exec ( void );
|
||||
bool WantsToQuit ( void ) const;
|
||||
|
||||
protected:
|
||||
explicit GameBase ( SDLMain* parSdlMain );
|
||||
|
@ -23,9 +24,11 @@ namespace cloonel {
|
|||
private:
|
||||
virtual void OnRender ( void ) = 0;
|
||||
virtual void OnUpdate ( float parDelta ) = 0;
|
||||
virtual bool ShouldQuit ( void ) const;
|
||||
|
||||
SDLMain* const m_sdlmain;
|
||||
unsigned int m_time0;
|
||||
bool m_wantsToQuit;
|
||||
};
|
||||
} //namespace cloonel
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue