The Joe Engine
Joe's engine programming playground
|
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... | |
The JEVulkanWindow class.
Wrapper class with convenience functions for the GLFW window used by the engine and the Vulkan surface object.
|
default |
Constructor (default).
|
default |
Destructor (default).
|
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).
void JoeEngine::JEVulkanWindow::Cleanup | ( | VkInstance | instance | ) |
Cleanup.
Makes crucial GLFW and Vulkan cleanup calls.
instance | the Vulkan instance used to cleanup. |
|
inline |
Get required instance extensions.
Invokes the glfw function returning the required extensions for the Vulkan instance.
count | a variable that is set to the number of required instance extensions that are returned. |
|
inline |
Get surface.
Returns the surface object.
|
inline |
Get the GLFW window.
Returns the GLFW window.
void JoeEngine::JEVulkanWindow::Initialize | ( | const int | w, |
const int | h, | ||
const std::string & | n | ||
) |
Initialization.
Makes crucial GLFW initialization calls.
w | window width. |
h | window height. |
n | window name. |
|
inline |
Set framebuffer callback function.
Invokes the glfw function that sets the framebuffer size-change callback function.
framebufferResizeCallback | the callback function. |
void JoeEngine::JEVulkanWindow::SetupVulkanSurface | ( | VkInstance | instance | ) |
Create a Vulkan surface.
Creates a vulkan surface object from the GLFW window.
instance | the Vulkan instance used to create the surface object. |
|
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).