From 327896b673cfedb0125860c7af2e564606f0d38d Mon Sep 17 00:00:00 2001 From: onelin Date: Sun, 15 Mar 2026 21:44:25 +0100 Subject: Assert no errors prior to creating textures --- src/rendering.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/rendering.c b/src/rendering.c index 01d6df1..0e6533f 100644 --- a/src/rendering.c +++ b/src/rendering.c @@ -827,7 +827,7 @@ void r_create_textures(void* restrict ctx, u32* restrict texture_array, const GladGLContext* gl = (GladGLContext*)ctx; i8 texture_dim = 2; - u32 err = 0; + u32 err = gl->GetError(); ivec3 texture_sz; ASSERT(texture_size != NULL); glm_ivec3_copy(*texture_size, texture_sz); @@ -839,6 +839,8 @@ void r_create_textures(void* restrict ctx, u32* restrict texture_array, // Check that if texture_dim == 0 then texture_sz[0] > 0. ASSERT(texture_sz[texture_dim] > 0); + ASSERT(!err); + switch (texture_dim) { case 0: gl->CreateTextures(GL_TEXTURE_1D, num_targets, texture_array); -- cgit v1.3