From 1114d9228eac7bbe49370c3be9145eb988c68a36 Mon Sep 17 00:00:00 2001 From: Andre Weissflog Date: Fri, 10 Oct 2025 19:25:55 +0200 Subject: sokol_gfx.h gl: fix missing _SOKOL_GL_HAS_* defines when SOKOL_EXTERNAL_GL_LOADER defined (fixes #1345) --- sokol_gfx.h | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) (limited to 'sokol_gfx.h') diff --git a/sokol_gfx.h b/sokol_gfx.h index c23b1896..c5a5c7cd 100644 --- a/sokol_gfx.h +++ b/sokol_gfx.h @@ -5405,11 +5405,6 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ #endif #include #pragma comment (lib, "kernel32") // GetProcAddress() - #define _SOKOL_GL_HAS_COMPUTE (1) - #define _SOKOL_GL_HAS_TEXSTORAGE (1) - #define _SOKOL_GL_HAS_TEXVIEWS (1) - #define _SOKOL_GL_HAS_BASEVERTEX (1) - #define _SOKOL_GL_HAS_BASEINSTANCE (1) #endif #elif defined(__APPLE__) #include @@ -5418,30 +5413,20 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ #endif #if defined(TARGET_OS_IPHONE) && !TARGET_OS_IPHONE #include - #define _SOKOL_GL_HAS_BASEVERTEX (1) #else #include #include - #define _SOKOL_GL_HAS_TEXSTORAGE (1) #endif #elif defined(__EMSCRIPTEN__) #if defined(SOKOL_GLES3) #include - #define _SOKOL_GL_HAS_TEXSTORAGE (1) #endif #elif defined(__ANDROID__) #include - #define _SOKOL_GL_HAS_COMPUTE (1) - #define _SOKOL_GL_HAS_TEXSTORAGE (1) #elif defined(__linux__) || defined(__unix__) - #define _SOKOL_GL_HAS_COMPUTE (1) - #define _SOKOL_GL_HAS_TEXSTORAGE (1) - #define _SOKOL_GL_HAS_BASEVERTEX (1) #if defined(SOKOL_GLCORE) #define GL_GLEXT_PROTOTYPES #include - #define _SOKOL_GL_HAS_TEXVIEWS (1) - #define _SOKOL_GL_HAS_BASEINSTANCE (1) #else #include #include @@ -5449,6 +5434,34 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_ #endif #endif + // broad GL feature availability defines (DON'T merge this into the above ifdef-block!) + #if defined(_WIN32) + #define _SOKOL_GL_HAS_COMPUTE (1) + #define _SOKOL_GL_HAS_TEXSTORAGE (1) + #define _SOKOL_GL_HAS_TEXVIEWS (1) + #define _SOKOL_GL_HAS_BASEVERTEX (1) + #define _SOKOL_GL_HAS_BASEINSTANCE (1) + #elif defined(__APPLE__) + #if defined(TARGET_OS_IPHONE) && !TARGET_OS_IPHONE + #define _SOKOL_GL_HAS_BASEVERTEX (1) + #else + #define _SOKOL_GL_HAS_TEXSTORAGE (1) + #endif + #elif defined(__EMSCRIPTEN__) + #define _SOKOL_GL_HAS_TEXSTORAGE (1) + #elif defined(__ANDROID__) + #define _SOKOL_GL_HAS_COMPUTE (1) + #define _SOKOL_GL_HAS_TEXSTORAGE (1) + #elif defined(__linux__) || defined(__unix__) + #define _SOKOL_GL_HAS_COMPUTE (1) + #define _SOKOL_GL_HAS_TEXSTORAGE (1) + #define _SOKOL_GL_HAS_BASEVERTEX (1) + #if defined(SOKOL_GLCORE) + #define _SOKOL_GL_HAS_TEXVIEWS (1) + #define _SOKOL_GL_HAS_BASEINSTANCE (1) + #endif + #endif + // optional GL loader definitions (only on Win32) #if defined(_SOKOL_USE_WIN32_GL_LOADER) #define __gl_h_ 1 -- cgit v1.2.3