Fling Engine  0.00.1
Fling Engine is a game engine written in Vulkan
Public Member Functions | Static Private Member Functions | Private Attributes
Fling::DesktopWindow Class Reference

Base class that represents a window to the Fling Engine using GLFW. More...

#include <DesktopWindow.h>

Inherits Fling::FlingWindow.

Public Member Functions

 DesktopWindow (const WindowProps &t_Props)
 
virtual ~DesktopWindow ()
 
virtual void CreateSurface (void *t_GraphicsInstance, void *t_SurfData) override
 Create the rendering surface for this window. More...
 
virtual void Update () override
 Tick the window (poll input from GLFW) More...
 
virtual void RecreateSwapChain () override
 Recreate the swap chain based on current window size with GLFW. More...
 
virtual int ShouldClose () override
 Check if this window should close. More...
 
virtual bool IsMinimized () const override
 Is this window currently minimized? More...
 
virtual UINT32 GetWidth () const override
 The current width of this window. More...
 
virtual UINT32 GetHeight () const override
 The current height of this window. More...
 
virtual float GetAspectRatio () const override
 The current aspect ratio of this windows. More...
 
virtual void SetMouseVisible (bool t_IsVisible) override
 Set whether the window hides the mouse cursor. More...
 
virtual bool GetMouseVisible () override
 Gets current visibility of mouse cursor. More...
 
void SetWindowIcon (Guid t_ID) override
 Set this window's icon. More...
 
GLFWwindow * GetGlfwWindow () const
 get the current GLFW window More...
 
virtual void SetWindowMode (WindowMode t_WindowMode) override
 Changes window mode between fullscreen, window, and borderless window. More...
 
virtual WindowMode GetWindowMode () override
 Gets current window mode. More...
 
- Public Member Functions inherited from Fling::FlingWindow
virtual ~FlingWindow ()=default
 
- Public Member Functions inherited from Fling::NonCopyable
 NonCopyable (const NonCopyable &)=delete
 
 NonCopyable (NonCopyable &&)=default
 
NonCopyableoperator= (const NonCopyable &)=delete
 
NonCopyableoperator= (NonCopyable &&)=default
 

Static Private Member Functions

static void FrameBufferResizeCallback (GLFWwindow *t_Window, int t_Width, int t_Height)
 

Private Attributes

GLFWwindow * m_Window = nullptr
 

Additional Inherited Members

- Static Public Member Functions inherited from Fling::FlingWindow
static FlingWindowCreate (const WindowProps &t_Props)
 Create a window with the given data. More...
 
- Protected Member Functions inherited from Fling::NonCopyable
 NonCopyable ()=default
 
virtual ~NonCopyable ()=default
 
- Protected Attributes inherited from Fling::FlingWindow
bool m_IsMouseVisible = true
 Tracks mouse visibility in window. More...
 
WindowMode m_WindowMode = WindowMode::Windowed
 Tracks current window mode. More...
 

Detailed Description

Base class that represents a window to the Fling Engine using GLFW.

Constructor & Destructor Documentation

◆ DesktopWindow()

Fling::DesktopWindow::DesktopWindow ( const WindowProps t_Props)

◆ ~DesktopWindow()

Fling::DesktopWindow::~DesktopWindow ( )
virtual

Member Function Documentation

◆ CreateSurface()

void Fling::DesktopWindow::CreateSurface ( void *  t_GraphicsInstance,
void *  t_SurfData 
)
overridevirtual

Create the rendering surface for this window.

Implements Fling::FlingWindow.

◆ FrameBufferResizeCallback()

void Fling::DesktopWindow::FrameBufferResizeCallback ( GLFWwindow *  t_Window,
int  t_Width,
int  t_Height 
)
staticprivate

◆ GetAspectRatio()

float Fling::DesktopWindow::GetAspectRatio ( ) const
overridevirtual

The current aspect ratio of this windows.

Implements Fling::FlingWindow.

◆ GetGlfwWindow()

GLFWwindow* Fling::DesktopWindow::GetGlfwWindow ( ) const
inline

get the current GLFW window

◆ GetHeight()

UINT32 Fling::DesktopWindow::GetHeight ( ) const
overridevirtual

The current height of this window.

Implements Fling::FlingWindow.

◆ GetMouseVisible()

bool Fling::DesktopWindow::GetMouseVisible ( )
overridevirtual

Gets current visibility of mouse cursor.

Implements Fling::FlingWindow.

◆ GetWidth()

UINT32 Fling::DesktopWindow::GetWidth ( ) const
overridevirtual

The current width of this window.

Implements Fling::FlingWindow.

◆ GetWindowMode()

WindowMode Fling::DesktopWindow::GetWindowMode ( )
overridevirtual

Gets current window mode.

Implements Fling::FlingWindow.

◆ IsMinimized()

bool Fling::DesktopWindow::IsMinimized ( ) const
overridevirtual

Is this window currently minimized?

Implements Fling::FlingWindow.

◆ RecreateSwapChain()

void Fling::DesktopWindow::RecreateSwapChain ( )
overridevirtual

Recreate the swap chain based on current window size with GLFW.

Implements Fling::FlingWindow.

◆ SetMouseVisible()

void Fling::DesktopWindow::SetMouseVisible ( bool  t_IsVisible)
overridevirtual

Set whether the window hides the mouse cursor.

Implements Fling::FlingWindow.

◆ SetWindowIcon()

void Fling::DesktopWindow::SetWindowIcon ( Guid  t_ID)
overridevirtual

Set this window's icon.

Parameters
t_IDthe GUID of the window icon

Implements Fling::FlingWindow.

◆ SetWindowMode()

void Fling::DesktopWindow::SetWindowMode ( WindowMode  t_WindowMode)
overridevirtual

Changes window mode between fullscreen, window, and borderless window.

Implements Fling::FlingWindow.

◆ ShouldClose()

int Fling::DesktopWindow::ShouldClose ( )
overridevirtual

Check if this window should close.

Returns
0 if the window should not close, non-zero if it should.

Implements Fling::FlingWindow.

◆ Update()

void Fling::DesktopWindow::Update ( )
overridevirtual

Tick the window (poll input from GLFW)

Implements Fling::FlingWindow.

Field Documentation

◆ m_Window

GLFWwindow* Fling::DesktopWindow::m_Window = nullptr
private

The documentation for this class was generated from the following files: