Files
Archimedes/layers/layer.h
2024-10-02 00:49:38 -05:00

36 lines
1.1 KiB
C++
Executable File

#pragma once
#include "engine.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;
};