Added hp and attack actions, and labels

This commit is contained in:
Vladislav Khorev committed 2026-04-25 12:07:52 +03:00
1 parent 393ebcd831
commit 44cc0fba67
8 files changed
+166 -9

No files matched your search

+8
View File
@@ -461,6 +461,11 @@ void TextRenderer::drawText(const std::string& text, float x, float y, float sca
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, atlasTexture->getTexID());
// The R8 atlas is sampled as alpha; without blending the non-glyph area
// of every quad writes opaque black and hides whatever is behind it.
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
//for (size_t i = 0; i < text.length(); ++i) {
// auto it = glyphs.find(text[i]);
// if (it == glyphs.end()) continue;
@@ -479,6 +484,9 @@ void TextRenderer::drawText(const std::string& text, float x, float y, float sca
//}
r->DrawVertexRenderStruct(cached.mesh);
//r->PopMatrix();
glDisable(GL_BLEND);
r->shaderManager.PopShader();
// Сброс бинда текстуры не обязателен, но можно для чистоты