HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
pipeline_box_vertex.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 "../vspan.hpp"
8#include "../numeric_array.hpp"
9#include "../aarect.hpp"
10#include "../color/sfloat_rgba16.hpp"
11#include "../color/sfloat_rgba32.hpp"
12#include "../color/sfloat_rgb32.hpp"
13#include <vulkan/vulkan.hpp>
14#include <span>
15
16namespace tt::pipeline_box {
17
21struct vertex {
24
27
30
33
36
39
40 float borderSize;
41
42 vertex(
46 float borderSize,
50 ) noexcept :
57 borderSize(borderSize) {}
58
59 static vk::VertexInputBindingDescription inputBindingDescription()
60 {
61 return {
62 0, sizeof(vertex), vk::VertexInputRate::eVertex
63 };
64 }
65
66 static std::vector<vk::VertexInputAttributeDescription> inputAttributeDescriptions()
67 {
68 return {
69 { 0, 0, vk::Format::eR32G32B32Sfloat, offsetof(vertex, position) },
70 { 1, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, clippingRectangle) },
71 { 2, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, cornerCoordinate) },
72 { 3, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(vertex, backgroundColor) },
73 { 4, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(vertex, borderColor) },
74 { 5, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(vertex, cornerShapes) },
75 { 6, 0, vk::Format::eR32Sfloat, offsetof(vertex, borderSize) },
76 };
77 }
78};
79}
This is a RGBA floating point color.
Definition color.hpp:39
Definition sfloat_rgb32.hpp:14
Definition sfloat_rgba16.hpp:17
Definition sfloat_rgba32.hpp:14
Definition pipeline_box_vertex.hpp:21
sfloat_rgba16 borderColor
border color of the box.
Definition pipeline_box_vertex.hpp:35
sfloat_rgba32 cornerCoordinate
Double 2D coordinates inside the quad, used to determine the distance from the sides and corner insid...
Definition pipeline_box_vertex.hpp:29
sfloat_rgba16 cornerShapes
Shape of each corner, negative values are cut corners, positive values are rounded corners.
Definition pipeline_box_vertex.hpp:38
sfloat_rgba32 clippingRectangle
The position in pixels of the clipping rectangle relative to the bottom-left corner of the window,...
Definition pipeline_box_vertex.hpp:26
sfloat_rgb32 position
The pixel-coordinates where the origin is located relative to the bottom-left corner of the window.
Definition pipeline_box_vertex.hpp:23
sfloat_rgba16 backgroundColor
background color of the box.
Definition pipeline_box_vertex.hpp:32