HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
PipelineBox_Vertex.hpp
1// Copyright 2019 Pokitec
2// All rights reserved.
3
4#pragma once
5
6#include "TTauri/Foundation/vspan.hpp"
7#include "TTauri/Foundation/vec.hpp"
8#include "TTauri/Foundation/aarect.hpp"
9#include "TTauri/Foundation/R16G16B16A16SFloat.hpp"
10#include "TTauri/Foundation/R32G32B32A32SFloat.hpp"
11#include "TTauri/Foundation/R32G32B32SFloat.hpp"
12#include <vulkan/vulkan.hpp>
13#include <nonstd/span>
14
15namespace tt::PipelineBox {
16
20struct Vertex {
23
26
29
32
35
38
39 float borderSize;
40
41 Vertex(
45 float borderSize,
49 ) noexcept :
56 borderSize(borderSize) {}
57
58 static vk::VertexInputBindingDescription inputBindingDescription()
59 {
60 return {
61 0, sizeof(Vertex), vk::VertexInputRate::eVertex
62 };
63 }
64
65 static std::vector<vk::VertexInputAttributeDescription> inputAttributeDescriptions()
66 {
67 return {
68 { 0, 0, vk::Format::eR32G32B32Sfloat, offsetof(Vertex, position) },
69 { 1, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(Vertex, clippingRectangle) },
70 { 2, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(Vertex, cornerCoordinate) },
71 { 3, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(Vertex, backgroundColor) },
72 { 4, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(Vertex, borderColor) },
73 { 5, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(Vertex, cornerShapes) },
74 { 6, 0, vk::Format::eR32Sfloat, offsetof(Vertex, borderSize) },
75 };
76 }
77};
78}
Class which represents an axis-aligned rectangle.
Definition aarect.hpp:13
Definition R16G16B16A16SFloat.hpp:15
Definition R32G32B32A32SFloat.hpp:13
Definition R32G32B32SFloat.hpp:13
A 4D vector.
Definition vec.hpp:37
Definition PipelineBox_Vertex.hpp:20
R16G16B16A16SFloat backgroundColor
background color of the box.
Definition PipelineBox_Vertex.hpp:31
R16G16B16A16SFloat borderColor
border color of the box.
Definition PipelineBox_Vertex.hpp:34
R32G32B32SFloat position
The pixel-coordinates where the origin is located relative to the bottom-left corner of the window.
Definition PipelineBox_Vertex.hpp:22
R32G32B32A32SFloat clippingRectangle
The position in pixels of the clipping rectangle relative to the bottom-left corner of the window,...
Definition PipelineBox_Vertex.hpp:25
R32G32B32A32SFloat cornerCoordinate
Double 2D coordinates inside the quad, used to determine the distance from the sides and corner insid...
Definition PipelineBox_Vertex.hpp:28
R16G16B16A16SFloat cornerShapes
Shape of each corner, negative values are cut corners, positive values are rounded corners.
Definition PipelineBox_Vertex.hpp:37