LampyEngine
 
Загрузка...
Поиск...
Не найдено
Класс Window

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.

Аргументы
widthWidth of the window in pixels.
heightHeight of the window in pixels.
titleTitle of the window.
Исключения
std::runtime_errorThrown 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_errorThrown if extension retrieval fails.

◆ getWindowSurface()

VkSurfaceKHR Window::getWindowSurface ( VkInstance instance)

Creates and retrieves the Vulkan surface associated with the window.

Аргументы
instanceThe Vulkan instance.
Возвращает
Handle to the created Vulkan surface.
Исключения
std::runtime_errorThrown 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.

Аргументы
cursorPosCallbackGLFW cursor position callback function.

◆ setKeyCallback()

void Window::setKeyCallback ( GLFWkeyfun keyCallback)

Sets the key callback function.

Аргументы
keyCallbackGLFW key callback function.

◆ setScrollCallback()

void Window::setScrollCallback ( GLFWscrollfun scrollCallback)

Sets the scroll callback function.

Аргументы
scrollCallbackGLFW 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.

Объявления и описания членов классов находятся в файлах: