@@ -71,7 +71,7 @@ void Renderer2D::Initialise(const char* const globalDataName)
71
71
quadIndexBuffer = Vulkan::IndexBuffer (6 , fontIndices);
72
72
73
73
quadVertexBuffer = Vulkan::VertexBuffer (sizeof (QuadVertex) * QUAD_VERTEX_BUFFER_SIZE);
74
- textVertexBuffer = Vulkan::VertexBuffer (sizeof (FontData ) * TEXT_VERTEX_BUFFER_SIZE);
74
+ textVertexBuffer = Vulkan::VertexBuffer (sizeof (FontVertex ) * TEXT_VERTEX_BUFFER_SIZE);
75
75
}
76
76
77
77
void Renderer2D::DrawQuad (const Vec2 position,
@@ -93,7 +93,7 @@ void Renderer2D::DrawQuad(const Vec2 position,
93
93
layerQuads[texIndex] = MHArray<QuadVertex>(MAX_QUADS_PER_LAYER);
94
94
95
95
layerQuads[texIndex].Append (
96
- {Graphics::CalculateTransform3D (Vec3 (position.x + scale.x , position.y + scale.y , zIndex ),
96
+ {Graphics::CalculateTransform3D (Vec3 (position.x + scale.x , position.y + scale.y , 1 . f ),
97
97
{0 .f , 0 .f , rotation},
98
98
scale),
99
99
ToFColour (colour),
@@ -115,7 +115,7 @@ void Renderer2D::DrawText2D(const char* const text,
115
115
auto & layerQuads = characters[zIndex];
116
116
117
117
if (texIndex >= layerQuads.Count ())
118
- layerQuads[texIndex] = MHArray<FontData >(MAX_TEXTS_PER_FONT * MAX_CHARS_PER_TEXT);
118
+ layerQuads[texIndex] = MHArray<FontVertex >(MAX_TEXTS_PER_FONT * MAX_CHARS_PER_TEXT);
119
119
120
120
auto & fontTexts = layerQuads[texIndex];
121
121
@@ -136,11 +136,11 @@ void Renderer2D::DrawText2D(const char* const text,
136
136
Vec4 coordinates = {x + glyph.bearingX , y - (height + yOffset), glyph.width , height};
137
137
138
138
fontTexts.Append (
139
- {Graphics::CalculateTransform3D (Vec3 (position.x , position.y + scale.y , zIndex ),
139
+ {Graphics::CalculateTransform3D (Vec3 (position.x , position.y + scale.y , 1 . f ),
140
140
{0 .f , 0 .f , rotation},
141
141
scale),
142
- {glyph.uvxMin , glyph.uvyMin , glyph.widthNormalised , glyph.heightNormalised },
143
142
ToFColour (colour),
143
+ {glyph.uvxMin , glyph.uvyMin , glyph.widthNormalised , glyph.heightNormalised },
144
144
coordinates / textScale});
145
145
146
146
x += glyph.advance >> 6 ;
@@ -199,7 +199,7 @@ void Renderer2D::RenderText(Vulkan::CommandBuffer& buffer, size_t index)
199
199
uint64_t vertexBufferOffset =
200
200
(index * MAX_TEXTURES) + (j * MAX_TEXTS_PER_FONT * MAX_CHARS_PER_TEXT);
201
201
202
- textVertexBuffer.Update (sizeof (FontData ),
202
+ textVertexBuffer.Update (sizeof (FontVertex ),
203
203
quadArr.Data (),
204
204
quadArr.Count (),
205
205
vertexBufferOffset);
0 commit comments