diff options
| author | onelin <oscar@nelin.dk> | 2026-03-15 20:44:25 +0000 |
|---|---|---|
| committer | onelin <oscar@nelin.dk> | 2026-03-15 21:10:14 +0000 |
| commit | 327896b673cfedb0125860c7af2e564606f0d38d (patch) | |
| tree | a5f93cd3c88ca566560fabe4ca07ea46e1b9abc7 /src | |
| parent | eae4554c1319110df28fd4dddfbb5a43ea1b89e0 (diff) | |
Assert no errors prior to creating textures
Diffstat (limited to 'src')
| -rw-r--r-- | src/rendering.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |
