25#ifndef TGUI_BACKEND_GLFW_VULKAN_INCLUDE_HPP
26#define TGUI_BACKEND_GLFW_VULKAN_INCLUDE_HPP
28#include <TGUI/Config.hpp>
29#if !TGUI_HAS_BACKEND_GLFW_VULKAN
30 #error "TGUI wasn't build with the GLFW_VULKAN backend"
33#include <TGUI/Backend/Font/FreeType/BackendFontFreeType.hpp>
34#include <TGUI/Backend/Renderer/Vulkan/BackendRendererVulkan.hpp>
35#include <TGUI/Backend/Window/GLFW/BackendGLFW.hpp>
39using GLFWwindow =
struct GLFWwindow;
45 inline namespace GLFW_VULKAN
106 VkFormat colorFormat,
107 std::uint32_t maxFramesInFlight,
108 std::uint32_t subpass = 0,
109 VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT);
133 std::uint32_t maxFramesInFlight,
134 VkFormat depthFormat = VK_FORMAT_UNDEFINED,
135 VkFormat stencilFormat = VK_FORMAT_UNDEFINED,
136 VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT);
141 TGUI_DEPRECATED(
"This backend requires a command buffer, use draw(VkCommandBuffer) instead") void
draw()
override
143 TGUI_ASSERT(
false,
"The GLFW_VULKAN backend requires that you pass a VkCommandBuffer to the draw function");
144 throw Exception(
"The GLFW_VULKAN backend requires that you pass a VkCommandBuffer to the draw function");
159 void draw(VkCommandBuffer cmdBuffer);
188 std::unique_ptr<SwapchainVulkan> m_swapchain;
BackendGuiGLFW()
Default constructor.
Wrapper for colors.
Definition Color.hpp:63
Definition Exception.hpp:46
void createSwapchain()
Creates a new surface and swapchain for the window, replacing the existing ones.
void renderFrame(Color clearColor) override
Clears the window, draws the gui and then presents the frame.
Gui(GLFWwindow *window, const VulkanContext &vulkanContext)
Constructor that immediately sets the window and Vulkan objects with which the gui should be drawn.
~Gui() override
Destructor.
void setRenderPass(VkRenderPass renderPass, VkFormat colorFormat, std::uint32_t maxFramesInFlight, std::uint32_t subpass=0, VkSampleCountFlagBits samples=VK_SAMPLE_COUNT_1_BIT)
Informs the gui about the render pass in which draw(cmdBuffer) will be called.
void setWindow(GLFWwindow *window, const VulkanContext &vulkanContext)
Sets the window and Vulkan objects with which the gui should be drawn.
void draw(VkCommandBuffer cmdBuffer)
Draws all the widgets that were added to the gui.
Gui()
Default constructor.
void setDynamicRenderingFormats(VkFormat colorFormat, std::uint32_t maxFramesInFlight, VkFormat depthFormat=VK_FORMAT_UNDEFINED, VkFormat stencilFormat=VK_FORMAT_UNDEFINED, VkSampleCountFlagBits samples=VK_SAMPLE_COUNT_1_BIT)
Informs the gui that draw(cmdBuffer) will be called while using dynamic rendering (vkCmdBeginRenderin...
void mainLoop(Color clearColor={240, 240, 240}) override
Give the gui control over the main loop.
void draw() override
This function is not used by this backend, use draw(VkCommandBuffer) instead.
Definition GLFW-Vulkan.hpp:141
Definition SwapchainVulkan.hpp:51
Namespace that contains all TGUI functions and classes.
Definition AbsoluteOrRelativeValue.hpp:37
Vulkan objects that TGUI needs to render.
Definition BackendRendererVulkan.hpp:50