Begin Repo

This commit is contained in:
2024-08-10 21:20:28 -05:00
commit 08115f90ce
41 changed files with 19581 additions and 0 deletions

35
layers/layer.h Normal file
View File

@@ -0,0 +1,35 @@
#pragma once
#include "terminal.h"
#include "event.h"
class Layer {
friend class EventHandler;
public:
Layer();
virtual ~Layer();
virtual void onAttach() = 0;
virtual void onDetach() = 0;
virtual void onUpdate() = 0;
virtual bool onEvent(const Event* event) = 0;
protected:
virtual bool onMouseButtonPressed(const MouseButtonEvent* event) = 0;
virtual bool onMouseButtonReleased(const MouseButtonEvent* event) = 0;
virtual bool onMouseMoved(const MouseMovedEvent* event) = 0;
virtual bool onMouseScrolled(const MouseScrolledEvent* event) = 0;
virtual bool onKeyPressed(const KeyEvent* event) = 0;
virtual bool onKeyReleased(const KeyEvent* event) = 0;
virtual bool onKeyTyped(const KeyTypedEvent* event) = 0;
virtual bool onWindowResize(const WindowEvent* event) = 0;
virtual bool onWindowFocus(const WindowEvent* event) = 0;
virtual bool onWindowFocusLost(const WindowEvent* event) = 0;
virtual bool onWindowClose(const WindowEvent* event) = 0;
virtual bool onWindowMoved(const WindowEvent* event) = 0;
};