Changed *.h files to *.hpp

This commit is contained in:
Kayne Ruse
2013-05-01 21:11:04 +10:00
parent cf82679109
commit 63aa248056
21 changed files with 47 additions and 47 deletions
+53
View File
@@ -0,0 +1,53 @@
#ifndef BASESCENE_HPP_
#define BASESCENE_HPP_
#include "scene_list.hpp"
#include "SDL/SDL.h"
class BaseScene {
public:
/* Public access members */
BaseScene();
virtual ~BaseScene();
/* Program control */
static SDL_Surface* SetScreen(int w, int h, int bpp = 0, Uint32 flags = SDL_HWSURFACE|SDL_DOUBLEBUF);
static SDL_Surface* GetScreen();
SceneList SetNextScene(SceneList sceneIndex);
SceneList GetNextScene() const;
/* Frame loop */
virtual void RunFrame();
protected:
virtual void FrameStart() {}
virtual void FrameEnd() {}
virtual void Update() {}
virtual void Render(SDL_Surface* const screen) {}
/* Event handlers */
virtual void HandleEvents();
virtual void QuitEvent () { SetNextScene(SceneList::QUIT); }
virtual void MouseMotion (SDL_MouseMotionEvent const&) {}
virtual void MouseButtonDown (SDL_MouseButtonEvent const&) {}
virtual void MouseButtonUp (SDL_MouseButtonEvent const&) {}
virtual void KeyDown (SDL_KeyboardEvent const&) {}
virtual void KeyUp (SDL_KeyboardEvent const&) {}
#ifdef USE_EVENT_JOYSTICK
//TODO: joystick/gamepad support
#endif
#ifdef USE_EVENT_UNKNOWN
virtual void UnknownEvent (SDL_Event const&) {}
#endif
private:
static SDL_Surface* screen;
SceneList nextScene;
};
#endif