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 "../geometry/axis_aligned_rectangle.hpp"
9#include "../color/sfloat_rgba16.hpp"
10#include "../color/sfloat_rgba32.hpp"
11#include "../color/sfloat_rgb32.hpp"
12#include <vulkan/vulkan.hpp>
13#include <span>
14
15namespace tt::pipeline_box {
16
20struct vertex {
23
26
37
40
43
46
47 float line_width;
48
49 vertex(
55 float line_width,
57 ) noexcept :
64 line_width(line_width)
65 {
66 }
67
68 static vk::VertexInputBindingDescription inputBindingDescription()
69 {
70 return {
71 0, sizeof(vertex), vk::VertexInputRate::eVertex
72 };
73 }
74
75 static std::vector<vk::VertexInputAttributeDescription> inputAttributeDescriptions()
76 {
77 return {
78 { 0, 0, vk::Format::eR32G32B32Sfloat, offsetof(vertex, position) },
79 { 1, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, clipping_rectangle) },
80 { 2, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, corner_coordinate) },
81 { 3, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(vertex, fill_color) },
82 { 4, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(vertex, line_color) },
83 { 5, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(vertex, corner_shapes) },
84 { 6, 0, vk::Format::eR32Sfloat, offsetof(vertex, line_width) },
85 };
86 }
87};
88}
This is a RGBA floating point color.
Definition color.hpp:39
Definition sfloat_rgb32.hpp:12
Definition sfloat_rgba16.hpp:18
Definition sfloat_rgba32.hpp:15
Class which represents an axis-aligned rectangle.
Definition axis_aligned_rectangle.hpp:18
Definition corner_shapes.hpp:9
Definition pipeline_box_vertex.hpp:20
sfloat_rgba16 fill_color
background color of the box.
Definition pipeline_box_vertex.hpp:39
sfloat_rgba32 corner_coordinate
Double 2D coordinates inside the quad, used to determine the distance from the sides and corner insid...
Definition pipeline_box_vertex.hpp:36
sfloat_rgba32 clipping_rectangle
The position in pixels of the clipping rectangle relative to the bottom-left corner of the window,...
Definition pipeline_box_vertex.hpp:25
sfloat_rgba16 line_color
border color of the box.
Definition pipeline_box_vertex.hpp:42
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:22
sfloat_rgba16 corner_shapes
Shape of each corner, negative values are cut corners, positive values are rounded corners.
Definition pipeline_box_vertex.hpp:45