From bf67a6e3a5a13c805061ee9dbf9241e63c2adff6 Mon Sep 17 00:00:00 2001 From: pommicket Date: Sun, 6 Aug 2023 09:56:41 -0400 Subject: shut up opengl --- main.c | 5 +++++ text.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 5c38d1c..24a775e 100644 --- a/main.c +++ b/main.c @@ -106,6 +106,11 @@ static void APIENTRY gl_message_callback(GLenum source, GLenum type, unsigned in GLsizei length, const char *message, const void *userParam) { (void)source; (void)type; (void)id; (void)length; (void)userParam; if (severity == GL_DEBUG_SEVERITY_NOTIFICATION) return; + if (strstr(message, "The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping")) { + // shut the fuck up + // why are you telling me this? + return; + } debug_println("Message from OpenGL: %s.", message); } #endif 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)); -- cgit v1.2.3