Working on minor bug fixing

This commit is contained in:
Vladislav Khorev committed 2026-03-10 18:03:16 +03:00
1 parent 5e7c050c68
commit 18674efd8e
15 files changed
+90 -24

No files matched your search

+5
View File
@@ -361,6 +361,8 @@ void TextRenderer::drawText(const std::string& text, float x, float y, float sca
// 4. Рендеринг
r->shaderManager.PushShader(shaderName);
//r->PushMatrix();
//r->LoadIdentity();
// Матрица проекции — используем виртуальные проекционные размеры,
// чтобы координаты текста были независимы от физического разрешения экрана.
@@ -373,6 +375,8 @@ void TextRenderer::drawText(const std::string& text, float x, float y, float sca
proj(0, 3) = -1.0f + 2.0f * (tx) / W;
proj(1, 3) = -1.0f + 2.0f * (ty) / H;
//cached.mesh.RefreshVBO();
r->RenderUniformMatrix4fv("uProjection", false, proj.data());
r->RenderUniform1i("uText", 0);
r->RenderUniform4fv("uColor", color.data());
@@ -397,6 +401,7 @@ void TextRenderer::drawText(const std::string& text, float x, float y, float sca
// glDrawArrays(GL_TRIANGLES, 0, 6);
//}
r->DrawVertexRenderStruct(cached.mesh);
//r->PopMatrix();
r->shaderManager.PopShader();
// Сброс бинда текстуры не обязателен, но можно для чистоты