Chronos 0.0
A advanced 2D rendering and animation system
Loading...
Searching...
No Matches
Chronos::Engine::TexturedVertex Struct Reference

This defines the position and texture coordinates of a vertex. Used when we need a textured vertex. More...

#include <Vertex.hpp>

Static Public Member Functions

static VkVertexInputBindingDescription getBindingDescription ()
 Creates a VkVertexInputBindingDescription for the vertex based on the size of the vertex.
 
static std::array< VkVertexInputAttributeDescription, 2 > getAttributeDescriptions ()
 Generates the VkVertexInputAttributeDescription for the vertex based on attributes(pos, texCoord) of the vertex.
 

Public Attributes

glm::vec2 pos
 
glm::vec2 texCoord
 

Detailed Description

This defines the position and texture coordinates of a vertex. Used when we need a textured vertex.

Definition at line 78 of file Vertex.hpp.

Member Function Documentation

◆ getAttributeDescriptions()

static std::array< VkVertexInputAttributeDescription, 2 > Chronos::Engine::TexturedVertex::getAttributeDescriptions ( )
inlinestatic

Generates the VkVertexInputAttributeDescription for the vertex based on attributes(pos, texCoord) of the vertex.

Definition at line 101 of file Vertex.hpp.

102 {
103 std::array<VkVertexInputAttributeDescription, 2>
104 attributeDescriptions {};
105
106 attributeDescriptions[0].binding = 0;
107 attributeDescriptions[0].location = 0;
108 attributeDescriptions[0].format = VK_FORMAT_R32G32_SFLOAT;
109 attributeDescriptions[0].offset = offsetof(TexturedVertex, pos);
110
111 attributeDescriptions[1].binding = 0;
112 attributeDescriptions[1].location = 1;
113 attributeDescriptions[1].format = VK_FORMAT_R32G32_SFLOAT;
114 attributeDescriptions[1].offset
115 = offsetof(TexturedVertex, texCoord);
116
117 return attributeDescriptions;
118 }

References pos, and texCoord.

Here is the caller graph for this function:

◆ getBindingDescription()

static VkVertexInputBindingDescription Chronos::Engine::TexturedVertex::getBindingDescription ( )
inlinestatic

Creates a VkVertexInputBindingDescription for the vertex based on the size of the vertex.

Definition at line 86 of file Vertex.hpp.

87 {
88 VkVertexInputBindingDescription bindingDescription {};
89 bindingDescription.binding = 0;
90 bindingDescription.stride = sizeof(TexturedVertex);
91 bindingDescription.inputRate = VK_VERTEX_INPUT_RATE_VERTEX;
92
93 return bindingDescription;
94 }
Here is the caller graph for this function:

Member Data Documentation

◆ pos

glm::vec2 Chronos::Engine::TexturedVertex::pos

Definition at line 79 of file Vertex.hpp.

◆ texCoord

glm::vec2 Chronos::Engine::TexturedVertex::texCoord

Definition at line 80 of file Vertex.hpp.


The documentation for this struct was generated from the following file: