25#ifndef TGUI_BACKEND_SDL_VULKAN_INCLUDE_HPP
26#define TGUI_BACKEND_SDL_VULKAN_INCLUDE_HPP
28#include <TGUI/Config.hpp>
29#if !TGUI_HAS_BACKEND_SDL_VULKAN
30 #error "TGUI wasn't build with the SDL_VULKAN backend"
33#include <TGUI/Backend/Font/FreeType/BackendFontFreeType.hpp>
34#include <TGUI/Backend/Renderer/Vulkan/BackendRendererVulkan.hpp>
35#include <TGUI/Backend/Window/SDL/BackendSDL.hpp>
43 inline namespace SDL_VULKAN
104 VkFormat colorFormat,
105 std::uint32_t maxFramesInFlight,
106 std::uint32_t subpass = 0,
107 VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT);
131 std::uint32_t maxFramesInFlight,
132 VkFormat depthFormat = VK_FORMAT_UNDEFINED,
133 VkFormat stencilFormat = VK_FORMAT_UNDEFINED,
134 VkSampleCountFlagBits samples = VK_SAMPLE_COUNT_1_BIT);
139 TGUI_DEPRECATED(
"This backend requires a command buffer, use draw(VkCommandBuffer) instead") void
draw()
override
141 TGUI_ASSERT(
false,
"The SDL_VULKAN backend requires that you pass a VkCommandBuffer to the draw function");
142 throw Exception(
"The SDL_VULKAN backend requires that you pass a VkCommandBuffer to the draw function");
157 void draw(VkCommandBuffer cmdBuffer);
191 std::unique_ptr<SwapchainVulkan> m_swapchain;
BackendGuiSDL()=default
Default constructor.
Wrapper for colors.
Definition Color.hpp:63
Definition Exception.hpp:46
~Gui() override
Destructor.
void createSwapchain()
Creates a new surface and swapchain for the window, replacing the existing ones.
void presentScreen() override
Not used by this backend.
Gui()
Default constructor.
void mainLoop(Color clearColor={240, 240, 240}) override
Give the gui control over the main loop.
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 draw(VkCommandBuffer cmdBuffer)
Draws all the widgets that were added to the gui.
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 setWindow(SDL_Window *window, const VulkanContext &vulkanContext)
Sets the window and Vulkan objects with which the gui should be drawn.
void renderFrame(Color clearColor) override
Clears the window, draws the gui and then presents the frame.
Gui(SDL_Window *window, const VulkanContext &vulkanContext)
Constructor that immediately sets the window and Vulkan objects with which the gui should be drawn.
void draw() override
This function is not used by this backend, use draw(VkCommandBuffer) instead.
Definition SDL-Vulkan.hpp:139
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