Encapsulates a GLFW window and manages Vulkan-related interactions.
Подробнее...
#include <Window.h>
|
| Window (int width, int height, const char *title) |
| Constructs a new GLFW window.
|
|
| ~Window () |
| Destroys the GLFW window and terminates GLFW.
|
|
bool | glfwWindowIsValid () const |
| Checks if the GLFW window is valid.
|
|
VkExtent2D | getExtent () |
| Retrieves the current window extent (width and height).
|
|
VkSurfaceKHR | getWindowSurface (VkInstance instance) |
| Creates and retrieves the Vulkan surface associated with the window.
|
|
std::vector< const char * > | getRequiredInstanceExtensions () |
| Retrieves the required instance extensions for Vulkan.
|
|
GLFWwindow * | getGLFWWindow () |
| Retrieves the raw GLFW window handle.
|
|
void | setKeyCallback (GLFWkeyfun keyCallback) |
| Sets the key callback function.
|
|
void | setCursorPositionCallback (GLFWcursorposfun cursorPosCallback) |
| Sets the cursor position callback function.
|
|
void | setScrollCallback (GLFWscrollfun scrollCallback) |
| Sets the scroll callback function.
|
|
bool | wasResized () const |
| Checks if the window was resized.
|
|
void | resetResizedFlag () |
| Resets the window resize flag.
|
|
void | pollEvents () |
| Polls for GLFW window events.
|
|
bool | shouldClose () const |
| Checks if the window should close.
|
|
float | currentTimeInSeconds () |
| Retrieves the current time since GLFW initialization.
|
|
Encapsulates a GLFW window and manages Vulkan-related interactions.
◆ Window()
Window::Window |
( |
int | width, |
|
|
int | height, |
|
|
const char * | title ) |
Constructs a new GLFW window.
- Аргументы
-
width | Width of the window in pixels. |
height | Height of the window in pixels. |
title | Title of the window. |
- Исключения
-
std::runtime_error | Thrown if GLFW initialization fails. |
◆ currentTimeInSeconds()
float Window::currentTimeInSeconds |
( |
| ) |
|
Retrieves the current time since GLFW initialization.
- Возвращает
- Elapsed time in seconds.
◆ getExtent()
VkExtent2D Window::getExtent |
( |
| ) |
|
Retrieves the current window extent (width and height).
- Возвращает
- VkExtent2D structure with the window dimensions.
◆ getGLFWWindow()
GLFWwindow * Window::getGLFWWindow |
( |
| ) |
|
|
inline |
Retrieves the raw GLFW window handle.
- Возвращает
- Pointer to the GLFW window.
◆ getRequiredInstanceExtensions()
std::vector< const char * > Window::getRequiredInstanceExtensions |
( |
| ) |
|
Retrieves the required instance extensions for Vulkan.
- Возвращает
- A vector of required Vulkan instance extensions.
- Исключения
-
std::runtime_error | Thrown if extension retrieval fails. |
◆ getWindowSurface()
VkSurfaceKHR Window::getWindowSurface |
( |
VkInstance | instance | ) |
|
Creates and retrieves the Vulkan surface associated with the window.
- Аргументы
-
instance | The Vulkan instance. |
- Возвращает
- Handle to the created Vulkan surface.
- Исключения
-
std::runtime_error | Thrown if surface creation fails. |
◆ glfwWindowIsValid()
bool Window::glfwWindowIsValid |
( |
| ) |
const |
|
inline |
Checks if the GLFW window is valid.
- Возвращает
- True if the window is successfully created, otherwise false.
◆ setCursorPositionCallback()
void Window::setCursorPositionCallback |
( |
GLFWcursorposfun | cursorPosCallback | ) |
|
Sets the cursor position callback function.
- Аргументы
-
cursorPosCallback | GLFW cursor position callback function. |
◆ setKeyCallback()
void Window::setKeyCallback |
( |
GLFWkeyfun | keyCallback | ) |
|
Sets the key callback function.
- Аргументы
-
keyCallback | GLFW key callback function. |
◆ setScrollCallback()
void Window::setScrollCallback |
( |
GLFWscrollfun | scrollCallback | ) |
|
Sets the scroll callback function.
- Аргументы
-
scrollCallback | GLFW scroll callback function. |
◆ shouldClose()
bool Window::shouldClose |
( |
| ) |
const |
|
inline |
Checks if the window should close.
- Возвращает
- True if the window should close, otherwise false.
◆ wasResized()
bool Window::wasResized |
( |
| ) |
const |
|
inline |
Checks if the window was resized.
- Возвращает
- True if the framebuffer was resized, otherwise false.
Объявления и описания членов классов находятся в файлах:
- Engine/Modules/WindowModule/Window.h
- Engine/Modules/WindowModule/Window.cpp