thirdparty: print the glGetError() code on failure too in sokol_gfx.h, to make diagnostic easier

This commit is contained in:
Delyan Angelov 2025-06-18 07:57:28 +03:00
parent 080684dda1
commit 37e5ead75d
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED

View file

@ -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