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

42 lines
833 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:
// #todo: don't handle Windows's window with glfw, create it yourself
2021-05-21 20:33:37 +04:30
GLFWwindow* m_Handle = nullptr;
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();
void PollEvents() override;
void OnEvent(const Event& event) override;
// Setters //
void SetProperties(const WindowProperties& properties) override;
void SetTitle(const std::string& title) override;
2021-05-21 20:33:37 +04:30
void SetSize(const glm::uvec2& size, bool add = false) override;
2021-05-21 20:33:37 +04:30
void SetVSync(bool vsync, bool toggle = false) override;
void SetVisibility(bool visible, bool toggle = false) override;
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
};
}