| Fling Engine 0.00.1 Fling Engine is a game engine written in Vulkan

DesktopWindow.h
Go to the documentation of this file.
1 #pragma once
2
3 #include "FlingWindow.h"
4
5 #ifndef GLFW_INCLUDE_VULKAN
6 # define GLFW_INCLUDE_VULKAN
7 #endif
8 #include <GLFW/glfw3.h>
9
10 namespace Fling
11 {
15 class DesktopWindow : public FlingWindow
16 {
17 public:
18
19 DesktopWindow(const WindowProps& t_Props);
20 virtual ~DesktopWindow();
21
22 virtual void CreateSurface(void* t_GraphicsInstance, void* t_SurfData) override;
23
25 virtual void Update() override;
26
28 virtual void RecreateSwapChain() override;
29
34 virtual int ShouldClose() override;
35
37 virtual bool IsMinimized() const override;
38
39 virtual UINT32 GetWidth() const override;
40
41 virtual UINT32 GetHeight() const override;
42
43 virtual float GetAspectRatio() const override;
44
45 virtual void SetMouseVisible(bool t_IsVisible) override;
46
47 virtual bool GetMouseVisible() override;
48
53 void SetWindowIcon(Guid t_ID) override;
54
56 GLFWwindow* GetGlfwWindow() const { return m_Window; }
57
58 virtual void SetWindowMode(WindowMode t_WindowMode) override;
59 virtual WindowMode GetWindowMode() override;
60 private:
61
62 GLFWwindow* m_Window = nullptr;
63
64 static void FrameBufferResizeCallback(GLFWwindow* t_Window, int t_Width, int t_Height);
65 };
66 } // namespace Fling
FlingWindow.h
Fling::WindowProps
Window creation data.
Definition: FlingWindow.h:17
Fling::FlingWindow
Base class that represents a window to the Fling Engine.
Definition: FlingWindow.h:27
Fling::DesktopWindow::SetWindowMode
virtual void SetWindowMode(WindowMode t_WindowMode) override
Changes window mode between fullscreen, window, and borderless window.
Definition: DesktopWindow.cpp:133
Fling::DesktopWindow::GetGlfwWindow
GLFWwindow * GetGlfwWindow() const
get the current GLFW window
Definition: DesktopWindow.h:56
Fling::DesktopWindow::~DesktopWindow
virtual ~DesktopWindow()
Definition: DesktopWindow.cpp:54
Fling::DesktopWindow
Base class that represents a window to the Fling Engine using GLFW.
Definition: DesktopWindow.h:15
WindowMode
WindowMode
Definition: FlingWindow.h:7
Fling::DesktopWindow::FrameBufferResizeCallback
static void FrameBufferResizeCallback(GLFWwindow *t_Window, int t_Width, int t_Height)
Definition: DesktopWindow.cpp:30
Fling::DesktopWindow::GetWidth
virtual UINT32 GetWidth() const override
The current width of this window.
Definition: DesktopWindow.cpp:75
Fling::DesktopWindow::GetHeight
virtual UINT32 GetHeight() const override
The current height of this window.
Definition: DesktopWindow.cpp:83
Fling::DesktopWindow::CreateSurface
virtual void CreateSurface(void *t_GraphicsInstance, void *t_SurfData) override
Create the rendering surface for this window.
Definition: DesktopWindow.cpp:34
Fling::DesktopWindow::GetAspectRatio
virtual float GetAspectRatio() const override
The current aspect ratio of this windows.
Definition: DesktopWindow.cpp:91
Fling::DesktopWindow::SetWindowIcon
void SetWindowIcon(Guid t_ID) override
Set this window&#39;s icon.
Definition: DesktopWindow.cpp:117
Fling::DesktopWindow::DesktopWindow
DesktopWindow(const WindowProps &t_Props)
Definition: DesktopWindow.cpp:15
Fling::Guid
entt::hashed_string Guid
Definition: FlingTypes.h:26
Fling::DesktopWindow::GetWindowMode
virtual WindowMode GetWindowMode() override
Gets current window mode.
Definition: DesktopWindow.cpp:165
Fling::DesktopWindow::IsMinimized
virtual bool IsMinimized() const override
Is this window currently minimized?
Definition: DesktopWindow.cpp:70
Fling::DesktopWindow::ShouldClose
virtual int ShouldClose() override
Check if this window should close.
Definition: DesktopWindow.cpp:65
Fling::DesktopWindow::GetMouseVisible
virtual bool GetMouseVisible() override
Gets current visibility of mouse cursor.
Definition: DesktopWindow.cpp:112
Fling::DesktopWindow::Update
virtual void Update() override
Tick the window (poll input from GLFW)
Definition: DesktopWindow.cpp:60
Fling::DesktopWindow::SetMouseVisible
virtual void SetMouseVisible(bool t_IsVisible) override
Set whether the window hides the mouse cursor.
Definition: DesktopWindow.cpp:99
UINT32
uint32_t UINT32
Definition: FlingTypes.h:13
Fling::DesktopWindow::m_Window
GLFWwindow * m_Window
Definition: DesktopWindow.h:62
Fling
Definition: Engine.h:29
Fling::DesktopWindow::RecreateSwapChain
virtual void RecreateSwapChain() override
Recreate the swap chain based on current window size with GLFW.
Definition: DesktopWindow.cpp:42