13 #define GLFW_INCLUDE_VULKAN 14 #include <GLFW/glfw3.h> 22 WindowVK::WindowVK(
int width,
int height, std::string title) :
Window() {
28 glfwDefaultWindowHints();
31 glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);
34 glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
37 handle = glfwCreateWindow(width, height, title.c_str(), NULL, NULL);
39 throw runtime_error(
"Could not create window!");
void present()
Presents the swapchain image.
void setKeyCallback(KeyCallback *callback)
Set the key callback.
Swapchain * getSwapchain()
Returns the swapchain of this context.
void swapBuffers() override
Swaps the framebuffers of this window.
This class contains all relevant Vulkan objects to setup a Vulkan application.
This class provides a basic GLFW window.
Generic namespace for the SimpleGL framework.
~WindowVK(void)
Destroys the window.
This class wraps a GLFW key callback.
void createSwapchain(Surface *surface, glm::ivec2 size)
Creates a swapchain for this context.
GLFWwindow * handle
The handle for the GLFW window.
std::string title
The title for the GLFW window.
static void setCurrent(VulkanContext *context)
Sets the current Vulkan context.
void setMouseButtonCallback(MouseButtonCallback *callback)
Set the mouse button callback.
void setupDebugCallback()
Creates a debug report callback, if compiled in debug mode.
void createLogicalDevice()
Creates the logical device for rendering.
void centerWindow()
Centers the window on the primary screen.
void acquireNextImage()
Updates the index for the swapchain images.
void pickPhysicalDevice(Surface *surface)
Enumerates all available physical devices and picks a suitable physical device.
This class wraps a Vulkan surface.
glm::ivec2 size
The size of the drawing area.