diff options
author | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-06-25 23:04:23 +0200 |
---|---|---|
committer | Vegard Storheil Eriksen <zyp@jvnv.net> | 2010-06-25 23:04:23 +0200 |
commit | f8d8934e33ebdb165655297d7eb427fccc19cea8 (patch) | |
tree | 1addf317bd1019def959e56469fb3c3bf3dc03ea /application.h | |
parent | 95adcb33f1e5cbc12afe22ed83b3b5c7f30fc4f7 (diff) |
Added Application-class.
Diffstat (limited to 'application.h')
-rw-r--r-- | application.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/application.h b/application.h new file mode 100644 index 0000000..ea8d899 --- /dev/null +++ b/application.h @@ -0,0 +1,27 @@ +#ifndef APPLICATION_H +#define APPLICATION_H + +#include <SDL/SDL.h> + +class Application { + private: + SDL_Surface *surface; + bool please_quit; + + protected: + void init_window(unsigned int w, unsigned int h, bool fs = false); + + virtual void event(const SDL_Event& e); + virtual void event_keypress(SDLKey key); + + virtual void update() = 0; + + public: + Application(); + virtual ~Application(); + + void run(); + void quit(); +}; + +#endif |