Revert "Revert "Added Screen interface""
This reverts commit 332ee7202e
.
This commit is contained in:
parent
332ee7202e
commit
3d747bbff8
|
@ -56,6 +56,7 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
while (window.IsOpen())
|
while (window.IsOpen())
|
||||||
true;
|
true;
|
||||||
|
|
||||||
window.Stop();
|
window.Stop();
|
||||||
|
|
||||||
|
|
||||||
|
|
21
src/sdlf/Screen.hpp
Normal file
21
src/sdlf/Screen.hpp
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "SDL.h"
|
||||||
|
|
||||||
|
namespace sf
|
||||||
|
{
|
||||||
|
class IScreen
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
protected:
|
||||||
|
IScreen();
|
||||||
|
|
||||||
|
virtual void OnFocus() = 0; // Called when the screen is being switched to
|
||||||
|
virtual void OnDefocus() = 0; // Called when the screen is being switched from
|
||||||
|
virtual void OnUpdate(double frametime) = 0; // Called every frame
|
||||||
|
virtual void OnEvent(const SDL_Event& event) = 0; // Called after an event occurs
|
||||||
|
|
||||||
|
private:
|
||||||
|
};
|
||||||
|
}
|
Loading…
Reference in a new issue