diff options
author | pommicket <pommicket@gmail.com> | 2023-08-06 15:24:55 -0400 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-08-06 15:24:55 -0400 |
commit | 823815101f55ca0ce67f36867b93934ccdba1953 (patch) | |
tree | 2766bf1cf860245445e52aa4626b0005fb701e4d | |
parent | 52da64686fb506372fa09ab562915f895cd88cb9 (diff) |
silence weird opengl warning
-rw-r--r-- | main.c | 7 | ||||
-rw-r--r-- | text.c | 6 | ||||
-rw-r--r-- | util.c | 4 | ||||
-rw-r--r-- | util.h | 1 |
4 files changed, 6 insertions, 12 deletions
@@ -1,6 +1,4 @@ /* -TODO: - - remove rect_translate? FUTURE FEATURES: - autodetect indentation (tabs vs spaces) - robust find (results shouldn't move around when you type things) @@ -100,11 +98,6 @@ 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 @@ -344,6 +344,12 @@ void text_render(Font *font) { glUniform2f(text_u_window_size, gl_window_width, gl_window_height); glDrawArrays(GL_TRIANGLES, 0, (GLsizei)(3 * ntriangles)); arr_clear(texture->triangles); + glBindTexture(GL_TEXTURE_2D, 0); + + // if i remove this i get + // Texture state usage warning: The texture object (0) bound to texture image unit 0 does not have a defined base level and cannot be used for texture mapping + // (even with no other draw calls) which is really weird but whatever this is probably good practice anyways. + glUseProgram(0); } if (font->fallback) { @@ -790,10 +790,6 @@ bool rect_contains_point(Rect r, vec2 point) { return rect_contains_point_v2(r.pos, r.size, point); } -Rect rect_translate(Rect r, vec2 by) { - return rect(vec2_add(r.pos, by), r.size); -} - float rect_x1(Rect r) { return r.pos.x; } float rect_y1(Rect r) { return r.pos.y; } float rect_x2(Rect r) { return r.pos.x + r.size.x; } @@ -228,7 +228,6 @@ Rect rect_xywh(float x, float y, float w, float h); Rect rect_centered(vec2 center, vec2 size); vec2 rect_center(Rect r); bool rect_contains_point(Rect r, vec2 point); -Rect rect_translate(Rect r, vec2 by); void rect_coords(Rect r, float *x1, float *y1, float *x2, float *y2); float rect_x1(Rect r); float rect_y1(Rect r); |