From 37e5ead75d18e0c4d1261b7858f3a6a63c642c9d Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Wed, 18 Jun 2025 07:57:28 +0300 Subject: [PATCH] thirdparty: print the glGetError() code on failure too in sokol_gfx.h, to make diagnostic easier --- thirdparty/sokol/sokol_gfx.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/thirdparty/sokol/sokol_gfx.h b/thirdparty/sokol/sokol_gfx.h index df133d1b1a..08277b7b1b 100644 --- a/thirdparty/sokol/sokol_gfx.h +++ b/thirdparty/sokol/sokol_gfx.h @@ -4877,7 +4877,9 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ #define GL_LUMINANCE 0x1909 #endif #ifndef _SG_GL_CHECK_ERROR - #define _SG_GL_CHECK_ERROR() { SOKOL_ASSERT(glGetError() == GL_NO_ERROR); } + // __v_ start + #define _SG_GL_CHECK_ERROR() { int glerr = glGetError(); if(glerr){ fprintf(stderr, ">> glGetError: %d\n", glerr); }; SOKOL_ASSERT(glerr == GL_NO_ERROR); } + // __v_ end #endif #endif