HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
pipeline_SDF_vertex.hpp
1// Copyright Take Vos 2020-2021.
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 "../geometry/module.hpp"
8#include "../image/module.hpp"
9#include <vulkan/vulkan.hpp>
10
11namespace hi::inline v1::pipeline_SDF {
12
16struct vertex {
19
22
25
28
29 vertex(point3 position, aarectangle clippingRectangle, point3 textureCoord, hi::color color) noexcept :
30 position(position), clippingRectangle(clippingRectangle), textureCoord(textureCoord), color(color)
31 {
32 }
33
34 static vk::VertexInputBindingDescription inputBindingDescription()
35 {
36 return {0, sizeof(vertex), vk::VertexInputRate::eVertex};
37 }
38
39 static std::vector<vk::VertexInputAttributeDescription> inputAttributeDescriptions()
40 {
41 return {
42 {0, 0, vk::Format::eR32G32B32Sfloat, offsetof(vertex, position)},
43 {1, 0, vk::Format::eR32G32B32A32Sfloat, offsetof(vertex, clippingRectangle)},
44 {2, 0, vk::Format::eR32G32B32Sfloat, offsetof(vertex, textureCoord)},
45 {3, 0, vk::Format::eR16G16B16A16Sfloat, offsetof(vertex, color)}};
46 }
47};
48
49} // namespace hi::inline v1::pipeline_SDF
DOXYGEN BUG.
Definition algorithm.hpp:13
This is a RGBA floating point color.
Definition color.hpp:42
Definition pipeline_alpha_vertex.hpp:18
sfloat_rgba32 clippingRectangle
Clipping rectangle. (x,y)=bottom-left, (z,w)=top-right.
Definition pipeline_SDF_vertex.hpp:21
sfloat_rgba16 color
The color of the glyph.
Definition pipeline_SDF_vertex.hpp:27
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:24
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:18
3 x float32 pixel format.
Definition sfloat_rgb32.hpp:20
4 x float16 pixel format.
Definition sfloat_rgba16.hpp:26
4 x float32 pixel format.
Definition sfloat_rgba32.hpp:22