fix: NVIDIA graphics card compatibility

This commit is contained in:
2026-03-30 14:24:42 +08:00
parent c23a7de81e
commit 618ba0ce1c
3 changed files with 15 additions and 10 deletions

View File

@@ -2,6 +2,7 @@
#include <Cubed/shader.hpp>
#include <Cubed/tools/font.hpp>
#include <Cubed/tools/log.hpp>
#include <Cubed/tools/shader_tools.hpp>
@@ -96,7 +97,6 @@ void Font::render_text(const Shader& shader, const std::string& text, float x, f
glUniform3f(shader.loc("textColor"), color.x, color.y, color.z);
glActiveTexture(GL_TEXTURE0);
std::vector<Vertex2D> vertices;
for (char8_t c : text) {
@@ -136,7 +136,7 @@ void Font::render_text(const Shader& shader, const std::string& text, float x, f
glEnableVertexAttribArray(1);
glEnableVertexAttribArray(2);
glDrawArrays(GL_TRIANGLES, 0, vertices.size() * 6);
glDrawArrays(GL_TRIANGLES, 0, vertices.size());
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindTexture(GL_TEXTURE_2D_ARRAY, 0);
glDeleteBuffers(1, &vbo);