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 "gfx_surface_delegate_vulkan.hpp"
8#include "../geometry/module.hpp"
9#include "../macros.hpp"
10#include <vulkan/vulkan.hpp>
11#include <vma/vk_mem_alloc.h>
12#include <vector>
13#include <cstdint>
14
15namespace hi::inline v1 {
16
24public:
25 virtual ~gfx_surface_delegate() = default;
26 constexpr gfx_surface_delegate() noexcept = default;
29 gfx_surface_delegate& operator=(gfx_surface_delegate const&) = delete;
30 gfx_surface_delegate& operator=(gfx_surface_delegate&&) = delete;
31
39 virtual void teardown_for_swapchain_lost() noexcept {}
40
43 virtual void teardown_for_device_lost() noexcept {}
44
57 VmaAllocator allocator,
58 vk::Instance instance,
59 vk::Device device,
60 vk::Queue graphics_queue,
61 uint32_t graphics_queue_family_index) noexcept
62 {
63 }
64
76 virtual void
77 build_for_new_swapchain(std::vector<vk::ImageView> const& views, vk::Extent2D size, vk::SurfaceFormatKHR format) noexcept
78 {
79 }
80
95 virtual void draw(uint32_t swapchain_index, vk::Semaphore start, vk::Semaphore finish, vk::Rect2D render_area) noexcept {}
96};
97
98} // namespace hi::inline v1
DOXYGEN BUG.
Definition algorithm.hpp:16
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
A delegate for drawing on a window below the HikoGUI user interface.
Definition gfx_surface_delegate_vulkan.hpp:23
virtual void teardown_for_swapchain_lost() noexcept
The swap-chain is going to be teared-down.
Definition gfx_surface_delegate_vulkan.hpp:39
virtual void teardown_for_device_lost() noexcept
The vulkan device is going to be teared-down.
Definition gfx_surface_delegate_vulkan.hpp:43
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:56
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:77
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:95