Cleaned up sprite render; use UVs

This commit is contained in:
2022-12-29 17:27:41 +00:00
parent 0bdfa9e814
commit 804c2de617
6 changed files with 43 additions and 38 deletions

View File

@@ -30,11 +30,6 @@ void font_init(struct shader *textshader) {
shader_use(shader);
glGenBuffers(1, &VBO);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0);
// Default font
//font = MakeFont("teenytinypixels.ttf", 30);
@@ -157,7 +152,6 @@ void renderText(const char *text, mfloat_t pos[2], float scale, mfloat_t color[3
glBindTexture(GL_TEXTURE_2D, font->texID);
glBindBuffer(GL_ARRAY_BUFFER, VBO);
glBufferData(GL_ARRAY_BUFFER, len*16*sizeof(float), NULL, GL_STREAM_DRAW);
glEnableVertexAttribArray(0);
glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, 4 * sizeof(float), 0);
const unsigned char *line, *wordstart;