diff options
author | pommicket <pommicket@gmail.com> | 2023-08-06 09:56:41 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-08-06 09:56:41 -0400 |
commit | bf67a6e3a5a13c805061ee9dbf9241e63c2adff6 (patch) | |
tree | 34e1b0ab5c633a9410d4395d3f60cac6c5c06e8c /text.c | |
parent | fe45ee7e366565d94d71facb3e04cd3d4a870758 (diff) |
shut up opengl
Diffstat (limited to 'text.c')
-rw-r--r-- | text.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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)); |