35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
#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;
|
|
|
|
}; |