light/Engine/src/Platform/OS/Windows/wWindow.h

41 lines
773 B
C
Raw Normal View History

2021-05-21 20:33:37 +04:30
#pragma once
#include "Base.h"
#include "Core/Window.h"
2021-05-27 18:55:30 +04:30
struct GLFWwindow;
2021-05-25 21:22:01 +04:30
2021-05-21 20:33:37 +04:30
namespace Light {
2021-05-27 18:55:30 +04:30
class Event;
2021-05-21 20:33:37 +04:30
class wWindow : public Window
{
private:
GLFWwindow* m_Handle = nullptr;
WindowProperties m_Properties = {};
2021-05-23 18:10:11 +04:30
std::function<void(Event&)> m_EventCallback;
2021-05-27 18:55:30 +04:30
2021-05-21 20:33:37 +04:30
public:
wWindow(std::function<void(Event&)> callback);
2021-05-21 20:33:37 +04:30
~wWindow();
virtual void SetProperties(const WindowProperties& properties) override;
virtual void SetVisible(bool visible) override;
2021-05-26 18:39:40 +04:30
virtual void PollEvents() override;
2021-05-25 18:35:52 +04:30
virtual void OnEvent(const Event& event) override;
2021-05-21 20:33:37 +04:30
virtual unsigned int GetWidth() override;
virtual unsigned int GetHeight() override;
virtual inline void* GetNativeHandle() override { return m_Handle; }
2021-05-27 18:55:30 +04:30
2021-05-23 18:10:11 +04:30
private:
void BindGlfwEvents();
2021-05-21 20:33:37 +04:30
};
}