diff options
-rw-r--r-- | main.c | 5 | ||||
-rw-r--r-- | text.c | 4 |
2 files changed, 7 insertions, 2 deletions
@@ -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 @@ -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)); |