HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Data Fields | Static Public Attributes
v1::gfx_surface_vulkan Class Referencefinal
Inheritance diagram for v1::gfx_surface_vulkan:
v1::gfx_surface v1::gui_window_vulkan_macos

Public Types

using super = gfx_surface
 

Public Member Functions

 gfx_surface_vulkan (gfx_system &system, vk::SurfaceKHR surface)
 
 gfx_surface_vulkan (const gfx_surface_vulkan &)=delete
 
gfx_surface_vulkanoperator= (const gfx_surface_vulkan &)=delete
 
 gfx_surface_vulkan (gfx_surface_vulkan &&)=delete
 
gfx_surface_vulkanoperator= (gfx_surface_vulkan &&)=delete
 
void init () override
 
void set_device (gfx_device *device) noexcept override
 
gfx_device_vulkanvulkan_device () const noexcept
 
extent2i size () const noexcept override
 Get the size of the surface.
 
void update (extent2i new_size) noexcept override
 Update the surface.
 
std::optional< gfx_draw_context > render_start (aarectanglei redraw_rectangle) override
 
void render_finish (gfx_draw_context const &context) override
 
void add_delegate (gfx_surface_delegate *delegate) noexcept override
 Add a delegate to handle extra rendering.
 
void remove_delegate (gfx_surface_delegate *delegate) noexcept override
 Remove a delegate.
 
- Public Member Functions inherited from v1::gfx_surface
 gfx_surface (const gfx_surface &)=delete
 
gfx_surfaceoperator= (const gfx_surface &)=delete
 
 gfx_surface (gfx_surface &&)=delete
 
gfx_surfaceoperator= (gfx_surface &&)=delete
 
 gfx_surface (gfx_system &system)
 
gfx_devicedevice () const noexcept
 

Data Fields

vk::SurfaceKHR intrinsic
 
vk::SwapchainKHR swapchain
 
uint32_t nrSwapchainImages
 
vk::Extent2D swapchainImageExtent
 
vk::SurfaceFormatKHR swapchainImageFormat
 
std::vector< swapchain_image_infoswapchain_image_infos
 
VmaAllocation depthImageAllocation
 
vk::Image depthImage
 
vk::ImageView depthImageView
 
std::array< VmaAllocation, 1 > colorImageAllocations
 
std::array< vk::Image, 1 > colorImages
 
std::array< vk::ImageView, 1 > colorImageViews
 
std::array< vk::DescriptorImageInfo, 1 > colorDescriptorImageInfos
 
vk::RenderPass renderPass
 
vk::CommandBuffer commandBuffer
 
vk::Semaphore imageAvailableSemaphore
 
vk::Semaphore renderFinishedSemaphore
 
vk::Fence renderFinishedFence
 
std::unique_ptr< pipeline_image::pipeline_image > image_pipeline
 
std::unique_ptr< pipeline_box::pipeline_box > box_pipeline
 
std::unique_ptr< pipeline_SDF::pipeline_SDF > SDF_pipeline
 
std::unique_ptr< pipeline_alpha::pipeline_alpha > alpha_pipeline
 
std::unique_ptr< pipeline_tone_mapper::pipeline_tone_mapper > tone_mapper_pipeline
 
- Data Fields inherited from v1::gfx_surface
gfx_systemsystem
 
gfx_surface_state state = gfx_surface_state::has_window
 
gfx_surface_loss loss = gfx_surface_loss::none
 

Static Public Attributes

static constexpr uint32_t defaultNumberOfSwapchainImages = 2
 
static const vk::Format depthImageFormat = vk::Format::eD16Unorm
 
static const vk::Format colorImageFormat = vk::Format::eR16G16B16A16Sfloat
 

Member Function Documentation

◆ add_delegate()

void v1::gfx_surface_vulkan::add_delegate ( gfx_surface_delegate * delegate)
overridevirtualnoexcept

Add a delegate to handle extra rendering.

The delegate can render underneath the HikoGUI user interface.

Implements v1::gfx_surface.

◆ init()

void v1::gfx_surface_vulkan::init ( )
overridevirtual

Reimplemented from v1::gfx_surface.

◆ remove_delegate()

void v1::gfx_surface_vulkan::remove_delegate ( gfx_surface_delegate * delegate)
overridevirtualnoexcept

Remove a delegate.

Implements v1::gfx_surface.

◆ render_finish()

void v1::gfx_surface_vulkan::render_finish ( gfx_draw_context const & context)
overridevirtual

Implements v1::gfx_surface.

◆ render_start()

std::optional< gfx_draw_context > v1::gfx_surface_vulkan::render_start ( aarectanglei redraw_rectangle)
overridevirtual

Implements v1::gfx_surface.

◆ set_device()

void v1::gfx_surface_vulkan::set_device ( gfx_device * device)
overridevirtualnoexcept

Set GPU device to manage this window. Change of the device may be done at runtime.

Parameters
deviceThe device to use for rendering, may be nullptr.

Reimplemented from v1::gfx_surface.

◆ size()

extent2i v1::gfx_surface_vulkan::size ( ) const
overridevirtualnoexcept

Get the size of the surface.

Implements v1::gfx_surface.

◆ update()

void v1::gfx_surface_vulkan::update ( extent2i new_size)
overridevirtualnoexcept

Update the surface.

This function will check if the graphic pipeline and swapchain needs to be build, rebuild, or torn down.

Parameters
new_sizeThe size of the window.

Implements v1::gfx_surface.


The documentation for this class was generated from the following file: