HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
PipelineBox_DeviceShared.hpp
1// Copyright 2019 Pokitec
2// All rights reserved.
3
4#pragma once
5
6#include "TTauri/GUI/GUIDevice_forward.hpp"
7#include "TTauri/Foundation/required.hpp"
8#include "TTauri/Foundation/vec.hpp"
9#include "TTauri/Foundation/rect.hpp"
10#include "TTauri/Foundation/vspan.hpp"
11#include <vma/vk_mem_alloc.h>
12#include <vulkan/vulkan.hpp>
13#include <mutex>
14
15namespace tt {
16template<typename T> struct PixelMap;
17}
18
19namespace tt::PipelineBox {
20
21struct Image;
22struct Vertex;
23
24struct DeviceShared final {
25 GUIDevice const &device;
26
27 vk::ShaderModule vertexShaderModule;
28 vk::ShaderModule fragmentShaderModule;
30
31 DeviceShared(GUIDevice const &device);
33
34 DeviceShared(DeviceShared const &) = delete;
35 DeviceShared &operator=(DeviceShared const &) = delete;
36 DeviceShared(DeviceShared &&) = delete;
37 DeviceShared &operator=(DeviceShared &&) = delete;
38
42 void destroy(GUIDevice *vulkanDevice);
43
44 void drawInCommandBuffer(vk::CommandBuffer &commandBuffer);
45
46 static void placeVertices(
47 vspan<Vertex> &vertices,
48 rect box,
49 vec backgroundColor,
50 float borderSize,
51 vec borderColor,
52 vec cornerShapes,
53 aarect clippingRectangle
54 );
55
56private:
57 void buildShaders();
58 void teardownShaders(GUIDevice_vulkan *vulkanDevice);
59};
60
61}
Class which represents an axis-aligned rectangle.
Definition aarect.hpp:13
Class which represents an axis-aligned rectangle.
Definition rect.hpp:15
A 4D vector.
Definition vec.hpp:37
Definition vspan.hpp:72
Definition GUIDevice_vulkan.hpp:22
Definition PipelineBox_DeviceShared.hpp:24
void destroy(GUIDevice *vulkanDevice)