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 
46  GLFWwindow* GetGlfwWindow() const { return m_Window; }
47 
48 
49 
50  private:
51 
52  GLFWwindow* m_Window = nullptr;
53 
54  static void FrameBufferResizeCallback(GLFWwindow* t_Window, int t_Width, int t_Height);
55 
56  };
57 } // namespace Fling
Window creation data.
Definition: FlingWindow.h:10
Base class that represents a window to the Fling Engine.
Definition: FlingWindow.h:20
GLFWwindow * GetGlfwWindow() const
get the current GLFW window
Definition: DesktopWindow.h:46
virtual ~DesktopWindow()
Definition: DesktopWindow.cpp:54
Base class that represents a window to the Fling Engine using GLFW.
Definition: DesktopWindow.h:15
static void FrameBufferResizeCallback(GLFWwindow *t_Window, int t_Width, int t_Height)
Definition: DesktopWindow.cpp:29
virtual UINT32 GetWidth() const override
The current width of this window.
Definition: DesktopWindow.cpp:75
virtual UINT32 GetHeight() const override
The current height of this window.
Definition: DesktopWindow.cpp:83
virtual void CreateSurface(void *t_GraphicsInstance, void *t_SurfData) override
Create the rendering surface for this window.
Definition: DesktopWindow.cpp:34
virtual float GetAspectRatio() const override
The current aspect ratio of this windows.
Definition: DesktopWindow.cpp:92
DesktopWindow(const WindowProps &t_Props)
Definition: DesktopWindow.cpp:14
virtual bool IsMinimized() const override
Is this window currently minimized?
Definition: DesktopWindow.cpp:70
virtual int ShouldClose() override
Check if this window should close.
Definition: DesktopWindow.cpp:65
virtual void Update() override
Tick the window (poll input from GLFW)
Definition: DesktopWindow.cpp:60
uint32_t UINT32
Definition: FlingTypes.h:10
GLFWwindow * m_Window
Definition: DesktopWindow.h:52
Definition: Engine.h:13
virtual void RecreateSwapChain() override
Recreate the swap chain based on current window size with GLFW.
Definition: DesktopWindow.cpp:42