HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Pipeline_SDF_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 "../numeric_array.hpp"
8#include "../aarect.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
14namespace tt::pipeline_SDF {
15
19struct vertex {
22
25
28
31
36 color(color) {}
37
38 static vk::VertexInputBindingDescription inputBindingDescription()
39 {
40 return {
41 0, sizeof(vertex), vk::VertexInputRate::eVertex
42 };
43 }
44
45 static std::vector<vk::VertexInputAttributeDescription> inputAttributeDescriptions()
46 {
47 return {
48 { 0, 0, vk::Format::eR32G32B32Sfloat, offsetof(vertex, position) },
49 { 1, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, clippingRectangle) },
50 { 2, 0, vk::Format::eR32G32B32Sfloat, offsetof(vertex, textureCoord) },
51 { 3, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(vertex, color) }
52 };
53 }
54};
55}
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_SDF_vertex.hpp:19
sfloat_rgb32 textureCoord
The x, y (relative to bottom-left) coordinate inside the texture-atlas, z is used as an index in the ...
Definition Pipeline_SDF_vertex.hpp:27
sfloat_rgba16 color
The color of the glyph.
Definition Pipeline_SDF_vertex.hpp:30
sfloat_rgb32 position
The pixel-coordinates where the origin is located relative to the bottom-left corner of the window.
Definition Pipeline_SDF_vertex.hpp:21
sfloat_rgba32 clippingRectangle
Clipping rectangle. (x,y)=bottom-left, (z,w)=top-right.
Definition Pipeline_SDF_vertex.hpp:24