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

39 lines
738 B
C
Raw Normal View History

2021-05-21 20:33:37 +04:30
#pragma once
2021-05-25 21:22:01 +04:30
#define GLFW_INCLUDE_NONE
2021-05-21 20:33:37 +04:30
#include "Base.h"
#include "Core/Window.h"
2021-05-23 18:10:11 +04:30
#include "Events/Event.h"
2021-05-21 20:33:37 +04:30
#include <GLFW/glfw3.h>
#include <memory>
2021-05-25 21:22:01 +04:30
2021-05-21 20:33:37 +04:30
namespace Light {
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-21 20:33:37 +04:30
public:
2021-05-23 18:10:11 +04:30
wWindow(const WindowProperties& properties, std::function<void(Event&)> callback);
2021-05-21 20:33:37 +04:30
~wWindow();
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-23 18:10:11 +04:30
private:
void BindGlfwEvents();
2021-05-21 20:33:37 +04:30
};
}