summaryrefslogtreecommitdiff
path: root/text.c
diff options
context:
space:
mode:
authorpommicket <pommicket@gmail.com>2023-08-06 09:56:41 -0400
committerpommicket <pommicket@gmail.com>2023-08-06 09:56:41 -0400
commitbf67a6e3a5a13c805061ee9dbf9241e63c2adff6 (patch)
tree34e1b0ab5c633a9410d4395d3f60cac6c5c06e8c /text.c
parentfe45ee7e366565d94d71facb3e04cd3d4a870758 (diff)
shut up opengl
Diffstat (limited to 'text.c')
-rw-r--r--text.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/text.c b/text.c
index 2736ab7..d939dbc 100644
--- a/text.c
+++ b/text.c
@@ -325,6 +325,8 @@ void text_render(Font *font) {
arr_foreach_ptr(font->textures, FontTexture, texture) {
size_t ntriangles = arr_len(texture->triangles);
if (!ntriangles) continue;
+ glActiveTexture(GL_TEXTURE0);
+ glBindTexture(GL_TEXTURE_2D, texture->tex);
font_texture_update_if_needed(texture);
// render these triangles
if (gl_version_major >= 3)
@@ -338,8 +340,6 @@ void text_render(Font *font) {
glVertexAttribPointer(text_v_color, 4, GL_FLOAT, 0, sizeof(TextVertex), (void *)offsetof(TextVertex, color));
glEnableVertexAttribArray(text_v_color);
glUseProgram(text_program);
- glActiveTexture(GL_TEXTURE0);
- glBindTexture(GL_TEXTURE_2D, texture->tex);
glUniform1i(text_u_sampler, 0);
glUniform2f(text_u_window_size, gl_window_width, gl_window_height);
glDrawArrays(GL_TRIANGLES, 0, (GLsizei)(3 * ntriangles));