Finality Engine
Loading...
Searching...
No Matches
GLFWWindowImpl.h
Go to the documentation of this file.
1
6#pragma once
7#include "Core.h"
8#include "Window.h"
9
10#include <GLFW/glfw3.h>
11
12#ifdef _WIN32
13#define GLFW_EXPOSE_NATIVE_WIN32
14#include <GLFW/glfw3native.h>
15#include <windows.h>
16#endif
17
18namespace FINALITY
19{
21 class GLFWWindowImpl : public Window
22 {
23 public:
24 void Initialize(const WindowSpec& specification) override;
25 void Update() override;
26 void Shutdown() override;
27
28 bool ShouldClose() const override;
29 uint32_t GetWidth() const override { return m_Specification.width; }
30 uint32_t GetHeight() const override { return m_Specification.height; }
31 WindowSpec GetSpecifications() const override { return m_Specification; }
32 NativeWindowHandle GetNativeHandles() const override { return m_NativeHandle; }
33
34 GLFWwindow* GetGLFWwindow() const { return m_Window; }
35
36 void SetCallbacks() override;
37 bool ConsumePendingResize(int& outW, int& outH) override;
38
39 void SetCursorMode(bool hiddenAndLocked) override;
40 void SetWindowTitle(const std::string& title) override;
41
42 private:
43 GLFWwindow* m_Window = nullptr;
44 WindowSpec m_Specification;
45
46 NativeWindowHandle m_NativeHandle;
47
48 bool m_PendingResize = false;
49 int m_PendingWidth = 0, m_PendingHeight = 0;
50 };
51}
bool ShouldClose() const override
void Initialize(const WindowSpec &specification) override
GLFWwindow * GetGLFWwindow() const
bool ConsumePendingResize(int &outW, int &outH) override
void Update() override
void SetCursorMode(bool hiddenAndLocked) override
NativeWindowHandle GetNativeHandles() const override
void SetCallbacks() override
void SetWindowTitle(const std::string &title) override
uint32_t GetWidth() const override
WindowSpec GetSpecifications() const override
uint32_t GetHeight() const override
void Shutdown() override