The Joe Engine
Joe's engine programming playground
JoeEngine::JEVulkanWindow Class Reference

The JEVulkanWindow class. More...

#include <VulkanWindow.h>

Public Member Functions

 JEVulkanWindow ()=default
 Constructor (default). More...
 
 ~JEVulkanWindow ()=default
 Destructor (default). More...
 
void Initialize (const int w, const int h, const std::string &n)
 Initialization. More...
 
void Cleanup (VkInstance instance)
 Cleanup. More...
 
void SetupVulkanSurface (VkInstance instance)
 Create a Vulkan surface. More...
 
VkSurfaceKHR GetSurface () const
 Get surface. More...
 
GLFWwindow * GetWindow () const
 Get the GLFW window. More...
 
bool ShouldClose () const
 Should window close. More...
 
const char ** GetRequiredInstanceExtensions (uint32_t *count) const
 Get required instance extensions. More...
 
void SetFrameBufferCallback (GLFWframebuffersizefun framebufferResizeCallback) const
 Set framebuffer callback function. More...
 
void AwaitMaximize (int *width, int *height) const
 Await window maximize. More...
 

Detailed Description

The JEVulkanWindow class.

Wrapper class with convenience functions for the GLFW window used by the engine and the Vulkan surface object.

Constructor & Destructor Documentation

◆ JEVulkanWindow()

JoeEngine::JEVulkanWindow::JEVulkanWindow ( )
default

Constructor (default).

◆ ~JEVulkanWindow()

JoeEngine::JEVulkanWindow::~JEVulkanWindow ( )
default

Destructor (default).

Member Function Documentation

◆ AwaitMaximize()

void JoeEngine::JEVulkanWindow::AwaitMaximize ( int *  width,
int *  height 
) const
inline

Await window maximize.

Makes glfw function calls that allows the application to sleep while minimized. This is called in a while loop from the renderer that constantly checks if the width and height parameters are equal to 0 (minimized) or not (maximized or otherwise).

◆ Cleanup()

void JoeEngine::JEVulkanWindow::Cleanup ( VkInstance  instance)

Cleanup.

Makes crucial GLFW and Vulkan cleanup calls.

Parameters
instancethe Vulkan instance used to cleanup.

◆ GetRequiredInstanceExtensions()

const char** JoeEngine::JEVulkanWindow::GetRequiredInstanceExtensions ( uint32_t *  count) const
inline

Get required instance extensions.

Invokes the glfw function returning the required extensions for the Vulkan instance.

Returns
pointer to list of extension names.
Parameters
counta variable that is set to the number of required instance extensions that are returned.

◆ GetSurface()

VkSurfaceKHR JoeEngine::JEVulkanWindow::GetSurface ( ) const
inline

Get surface.

Returns the surface object.

Returns
the surface object.

◆ GetWindow()

GLFWwindow* JoeEngine::JEVulkanWindow::GetWindow ( ) const
inline

Get the GLFW window.

Returns the GLFW window.

Returns
the GLFW window.

◆ Initialize()

void JoeEngine::JEVulkanWindow::Initialize ( const int  w,
const int  h,
const std::string &  n 
)

Initialization.

Makes crucial GLFW initialization calls.

Parameters
wwindow width.
hwindow height.
nwindow name.

◆ SetFrameBufferCallback()

void JoeEngine::JEVulkanWindow::SetFrameBufferCallback ( GLFWframebuffersizefun  framebufferResizeCallback) const
inline

Set framebuffer callback function.

Invokes the glfw function that sets the framebuffer size-change callback function.

Parameters
framebufferResizeCallbackthe callback function.

◆ SetupVulkanSurface()

void JoeEngine::JEVulkanWindow::SetupVulkanSurface ( VkInstance  instance)

Create a Vulkan surface.

Creates a vulkan surface object from the GLFW window.

Parameters
instancethe Vulkan instance used to create the surface object.

◆ ShouldClose()

bool JoeEngine::JEVulkanWindow::ShouldClose ( ) const
inline

Should window close.

Invokes the glfw function checking if the window should close, (e.g. the user clicked the red X to close the window).

Returns
true if the window should close, false otherwise.

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