HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
gfx_surface_delegate_vulkan.hpp
1// Copyright Take Vos 2022.
2// Distributed under the Boost Software License, Version 1.0.
3// (See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
4
5#pragma once
6
7#include "../geometry/geometry.hpp"
8#include "../macros.hpp"
9#include <vulkan/vulkan.hpp>
10#include <vma/vk_mem_alloc.h>
11#include <vector>
12#include <cstdint>
13
14hi_export_module(hikogui.GFX : gfx_surface_delegate);
15
16hi_export namespace hi::inline v1 {
17
25public:
26 virtual ~gfx_surface_delegate() = default;
27 constexpr gfx_surface_delegate() noexcept = default;
30 gfx_surface_delegate& operator=(gfx_surface_delegate const&) = delete;
31 gfx_surface_delegate& operator=(gfx_surface_delegate&&) = delete;
32
40 virtual void teardown_for_swapchain_lost() noexcept {}
41
44 virtual void teardown_for_device_lost() noexcept {}
45
58 VmaAllocator allocator,
59 vk::Instance instance,
60 vk::Device device,
61 vk::Queue graphics_queue,
62 uint32_t graphics_queue_family_index) noexcept
63 {
64 }
65
77 virtual void
78 build_for_new_swapchain(std::vector<vk::ImageView> const& views, vk::Extent2D size, vk::SurfaceFormatKHR format) noexcept
79 {
80 }
81
96 virtual void draw(uint32_t swapchain_index, vk::Semaphore start, vk::Semaphore finish, vk::Rect2D render_area) noexcept {}
97};
98
99} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
A delegate for drawing on a window below the HikoGUI user interface.
Definition gfx_surface_delegate_vulkan.hpp:24
virtual void teardown_for_swapchain_lost() noexcept
The swap-chain is going to be teared-down.
Definition gfx_surface_delegate_vulkan.hpp:40
virtual void teardown_for_device_lost() noexcept
The vulkan device is going to be teared-down.
Definition gfx_surface_delegate_vulkan.hpp:44
virtual void build_for_new_device(VmaAllocator allocator, vk::Instance instance, vk::Device device, vk::Queue graphics_queue, uint32_t graphics_queue_family_index) noexcept
The vulkan device has been initialized.
Definition gfx_surface_delegate_vulkan.hpp:57
virtual void build_for_new_swapchain(std::vector< vk::ImageView > const &views, vk::Extent2D size, vk::SurfaceFormatKHR format) noexcept
The swap-chain has been build.
Definition gfx_surface_delegate_vulkan.hpp:78
virtual void draw(uint32_t swapchain_index, vk::Semaphore start, vk::Semaphore finish, vk::Rect2D render_area) noexcept
Draw using vulkan API.
Definition gfx_surface_delegate_vulkan.hpp:96