HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
pipeline_box_device_shared.hpp
1// Copyright Take Vos 2020.
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 "../required.hpp"
8#include "../geometry/rectangle.hpp"
9#include "../vspan.hpp"
10#include "../color/color.hpp"
11#include <vk_mem_alloc.h>
12#include "../geometry/corner_shapes.hpp"
13#include <vulkan/vulkan.hpp>
14#include <mutex>
15
16namespace tt {
17class gfx_device_vulkan;
18}
19
20namespace tt::pipeline_box {
21struct Image;
22struct vertex;
23
24struct device_shared final {
25 gfx_device_vulkan const &device;
26
27 vk::ShaderModule vertexShaderModule;
28 vk::ShaderModule fragmentShaderModule;
30
31 device_shared(gfx_device_vulkan const &device);
33
34 device_shared(device_shared const &) = delete;
35 device_shared &operator=(device_shared const &) = delete;
36 device_shared(device_shared &&) = delete;
37 device_shared &operator=(device_shared &&) = delete;
38
42 void destroy(gfx_device_vulkan *vulkanDevice);
43
44 void drawInCommandBuffer(vk::CommandBuffer &commandBuffer);
45
46 static void place_vertices(
47 vspan<vertex> &vertices,
48 aarectangle clipping_rectangle,
49 rectangle box,
50 color fill_color,
51 color line_color,
52 float line_width,
54 );
55
56private:
57 void buildShaders();
58 void teardownShaders(gfx_device_vulkan *vulkanDevice);
59};
60
61}
This is a RGBA floating point color.
Definition color.hpp:36
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:20
Definition corner_shapes.hpp:9
Class which represents an rectangle.
Definition rectangle.hpp:16
Definition gfx_device_vulkan.hpp:24
Definition pipeline_box_device_shared.hpp:24
void destroy(gfx_device_vulkan *vulkanDevice)
Definition vspan.hpp:73