aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2024-03-10 16:40:39 +0100
committerAndre Weissflog <floooh@gmail.com>2024-03-10 16:40:39 +0100
commitfb77929fb48c1256c24fa6cb758665a3ea7d3130 (patch)
treede91cc7768b72609308d837df7bef1c512c4e2e9
parent71df9eb978b4920d50acf3d3e7f4079becc338c3 (diff)
replace SOKOL_GLCORE33 with SOKOL_GLCORE
-rw-r--r--CHANGELOG.md4
-rw-r--r--bindgen/gen_nim.py6
-rw-r--r--sokol_app.h56
-rw-r--r--sokol_gfx.h36
-rw-r--r--tests/CMakeLists.txt4
-rw-r--r--tests/CMakePresets.json26
-rw-r--r--tests/functional/force_dummy_backend.h4
-rw-r--r--util/sokol_debugtext.h8
-rw-r--r--util/sokol_fontstash.h8
-rw-r--r--util/sokol_gl.h8
-rw-r--r--util/sokol_imgui.h8
-rw-r--r--util/sokol_nuklear.h8
-rw-r--r--util/sokol_spine.h8
13 files changed, 92 insertions, 92 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6b0414e4..fb43b716 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1240,8 +1240,8 @@ GLES2/WebGL1 support has been removed from the sokol headers (now that
GLX for the window system glue code and can create a GLES2 or GLES3 context
instead of a 'desktop GL' context.
To get EGL+GLES2/GLES3, just define SOKOL_GLES2 or SOKOL_GLES3 to compile the
- implementation. To get EGL+GL, define SOKOL_GLCORE33 *and* SOKOL_FORCE_EGL.
- By default, defining just SOKOL_GLCORE33 uses GLX for the window system glue
+ implementation. To get EGL+GL, define SOKOL_GLCORE *and* SOKOL_FORCE_EGL.
+ By default, defining just SOKOL_GLCORE uses GLX for the window system glue
(just as before). Many thanks to GH user @billzez for the PR!
- **10-Sep-2022**: sokol_app.h and sokol_args.h has been fixed for Emscripten 3.21, those headers
diff --git a/bindgen/gen_nim.py b/bindgen/gen_nim.py
index 700305ab..0468dfb3 100644
--- a/bindgen/gen_nim.py
+++ b/bindgen/gen_nim.py
@@ -513,7 +513,7 @@ def gen_extra(inp):
l(' when not defined vcc:')
l(' {.passl:"-lkernel32 -luser32 -lshell32 -lgdi32".}')
l(' when defined gl:')
- l(' {.passc:"-DSOKOL_GLCORE33".}')
+ l(' {.passc:"-DSOKOL_GLCORE".}')
l(' else:')
l(' {.passc:"-DSOKOL_D3D11".}')
l(' when not defined vcc:')
@@ -522,13 +522,13 @@ def gen_extra(inp):
l(' {.passc:"-x objective-c".}')
l(' {.passl:"-framework Cocoa -framework QuartzCore".}')
l(' when defined gl:')
- l(' {.passc:"-DSOKOL_GLCORE33".}')
+ l(' {.passc:"-DSOKOL_GLCORE".}')
l(' {.passl:"-framework OpenGL".}')
l(' else:')
l(' {.passc:"-DSOKOL_METAL".}')
l(' {.passl:"-framework Metal -framework MetalKit".}')
l('elif defined linux:')
- l(' {.passc:"-DSOKOL_GLCORE33".}')
+ l(' {.passc:"-DSOKOL_GLCORE".}')
l(' {.passl:"-lX11 -lXi -lXcursor -lGL -lm -ldl -lpthread".}')
l('else:')
l(' error("unsupported platform")')
diff --git a/sokol_app.h b/sokol_app.h
index db73ebbe..95dcf640 100644
--- a/sokol_app.h
+++ b/sokol_app.h
@@ -18,7 +18,7 @@
the backend selected for sokol_gfx.h if both are used in the same
project):
- #define SOKOL_GLCORE33
+ #define SOKOL_GLCORE
#define SOKOL_GLES3
#define SOKOL_D3D11
#define SOKOL_METAL
@@ -47,7 +47,7 @@
On Windows, SOKOL_DLL will define SOKOL_APP_API_DECL as __declspec(dllexport)
or __declspec(dllimport) as needed.
- On Linux, SOKOL_GLCORE33 can use either GLX or EGL.
+ On Linux, SOKOL_GLCORE can use either GLX or EGL.
GLX is default, set SOKOL_FORCE_EGL to override.
For example code, see https://github.com/floooh/sokol-samples/tree/master/sapp
@@ -1959,8 +1959,8 @@ inline void sapp_run(const sapp_desc& desc) { return sapp_run(&desc); }
#if defined(TARGET_OS_IPHONE) && !TARGET_OS_IPHONE
/* MacOS */
#define _SAPP_MACOS (1)
- #if !defined(SOKOL_METAL) && !defined(SOKOL_GLCORE33)
- #error("sokol_app.h: unknown 3D API selected for MacOS, must be SOKOL_METAL or SOKOL_GLCORE33")
+ #if !defined(SOKOL_METAL) && !defined(SOKOL_GLCORE)
+ #error("sokol_app.h: unknown 3D API selected for MacOS, must be SOKOL_METAL or SOKOL_GLCORE")
#endif
#else
/* iOS or iOS Simulator */
@@ -1978,8 +1978,8 @@ inline void sapp_run(const sapp_desc& desc) { return sapp_run(&desc); }
#elif defined(_WIN32)
/* Windows (D3D11 or GL) */
#define _SAPP_WIN32 (1)
- #if !defined(SOKOL_D3D11) && !defined(SOKOL_GLCORE33)
- #error("sokol_app.h: unknown 3D API selected for Win32, must be SOKOL_D3D11 or SOKOL_GLCORE33")
+ #if !defined(SOKOL_D3D11) && !defined(SOKOL_GLCORE)
+ #error("sokol_app.h: unknown 3D API selected for Win32, must be SOKOL_D3D11 or SOKOL_GLCORE")
#endif
#elif defined(__ANDROID__)
/* Android */
@@ -1993,7 +1993,7 @@ inline void sapp_run(const sapp_desc& desc) { return sapp_run(&desc); }
#elif defined(__linux__) || defined(__unix__)
/* Linux */
#define _SAPP_LINUX (1)
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
#if !defined(SOKOL_FORCE_EGL)
#define _SAPP_GLX (1)
#endif
@@ -2003,13 +2003,13 @@ inline void sapp_run(const sapp_desc& desc) { return sapp_run(&desc); }
#include <GLES3/gl3.h>
#include <GLES3/gl3ext.h>
#else
- #error("sokol_app.h: unknown 3D API selected for Linux, must be SOKOL_GLCORE33, SOKOL_GLES3")
+ #error("sokol_app.h: unknown 3D API selected for Linux, must be SOKOL_GLCORE, SOKOL_GLES3")
#endif
#else
#error "sokol_app.h: Unknown platform"
#endif
-#if defined(SOKOL_GLCORE33) || defined(SOKOL_GLES3)
+#if defined(SOKOL_GLCORE) || defined(SOKOL_GLES3)
#define _SAPP_ANY_GL (1)
#endif
@@ -2399,11 +2399,11 @@ _SOKOL_PRIVATE double _sapp_timing_get_avg(_sapp_timing_t* t) {
#if defined(SOKOL_METAL)
@interface _sapp_macos_view : MTKView
@end
-#elif defined(SOKOL_GLCORE33)
+#elif defined(SOKOL_GLCORE)
@interface _sapp_macos_view : NSOpenGLView
- (void)timerFired:(id)sender;
@end
-#endif // SOKOL_GLCORE33
+#endif // SOKOL_GLCORE
typedef struct {
uint32_t flags_changed_store;
@@ -2545,7 +2545,7 @@ typedef struct {
uint8_t raw_input_data[256];
} _sapp_win32_t;
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
#define WGL_SUPPORT_OPENGL_ARB 0x2010
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
@@ -2605,7 +2605,7 @@ typedef struct {
HWND msg_hwnd;
HDC msg_dc;
} _sapp_wgl_t;
-#endif // SOKOL_GLCORE33
+#endif // SOKOL_GLCORE
#endif // _SAPP_WIN32
@@ -2876,7 +2876,7 @@ typedef struct {
_sapp_win32_t win32;
#if defined(SOKOL_D3D11)
_sapp_d3d11_t d3d11;
- #elif defined(SOKOL_GLCORE33)
+ #elif defined(SOKOL_GLCORE)
_sapp_wgl_t wgl;
#endif
#elif defined(_SAPP_ANDROID)
@@ -3650,7 +3650,7 @@ _SOKOL_PRIVATE void _sapp_macos_update_dimensions(void) {
const int cur_fb_height = (int)roundf(fb_size.height);
const bool dim_changed = (_sapp.framebuffer_width != cur_fb_width) ||
(_sapp.framebuffer_height != cur_fb_height);
- #elif defined(SOKOL_GLCORE33)
+ #elif defined(SOKOL_GLCORE)
const int cur_fb_width = (int)roundf(bounds.size.width * _sapp.dpi_scale);
const int cur_fb_height = (int)roundf(bounds.size.height * _sapp.dpi_scale);
const bool dim_changed = (_sapp.framebuffer_width != cur_fb_width) ||
@@ -3892,7 +3892,7 @@ _SOKOL_PRIVATE void _sapp_macos_frame(void) {
_sapp.macos.window.contentView = _sapp.macos.view;
[_sapp.macos.window makeFirstResponder:_sapp.macos.view];
_sapp.macos.view.layer.magnificationFilter = kCAFilterNearest;
- #elif defined(SOKOL_GLCORE33)
+ #elif defined(SOKOL_GLCORE)
NSOpenGLPixelFormatAttribute attrs[32];
int i = 0;
attrs[i++] = NSOpenGLPFAAccelerated;
@@ -4124,7 +4124,7 @@ _SOKOL_PRIVATE void _sapp_macos_frame(void) {
@end
@implementation _sapp_macos_view
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
- (void)timerFired:(id)sender {
_SOKOL_UNUSED(sender);
[self setNeedsDisplay:YES];
@@ -4224,7 +4224,7 @@ _SOKOL_PRIVATE void _sapp_macos_poll_input_events(void) {
// helper function to make GL context active
static void _sapp_gl_make_current(void) {
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
[[_sapp.macos.view openGLContext] makeCurrentContext];
#endif
}
@@ -5945,7 +5945,7 @@ int main(int argc, char* argv[]) {
// ██████ ███████ ██ ██ ███████ ███████ ██ ███████ ██ ██ ███████
//
// >>gl helpers
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
typedef struct {
int red_bits;
int green_bits;
@@ -6596,7 +6596,7 @@ _SOKOL_PRIVATE void _sapp_d3d11_present(bool do_not_wait) {
#endif /* SOKOL_D3D11 */
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
_SOKOL_PRIVATE void _sapp_wgl_init(void) {
_sapp.wgl.opengl32 = LoadLibraryA("opengl32.dll");
if (!_sapp.wgl.opengl32) {
@@ -6894,7 +6894,7 @@ _SOKOL_PRIVATE void _sapp_wgl_swap_buffers(void) {
/* FIXME: DwmIsCompositionEnabled? (see GLFW) */
SwapBuffers(_sapp.win32.dc);
}
-#endif /* SOKOL_GLCORE33 */
+#endif /* SOKOL_GLCORE */
_SOKOL_PRIVATE bool _sapp_win32_wide_to_utf8(const wchar_t* src, char* dst, int dst_num_bytes) {
SOKOL_ASSERT(src && dst && (dst_num_bytes > 1));
@@ -7311,7 +7311,7 @@ _SOKOL_PRIVATE void _sapp_win32_timing_measure(void) {
// fallback if swap model isn't "flip-discard" or GetFrameStatistics failed for another reason
_sapp_timing_measure(&_sapp.timing);
#endif
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
_sapp_timing_measure(&_sapp.timing);
#endif
}
@@ -7513,7 +7513,7 @@ _SOKOL_PRIVATE LRESULT CALLBACK _sapp_win32_wndproc(HWND hWnd, UINT uMsg, WPARAM
// present with DXGI_PRESENT_DO_NOT_WAIT
_sapp_d3d11_present(true);
#endif
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
_sapp_wgl_swap_buffers();
#endif
/* NOTE: resizing the swap-chain during resize leads to a substantial
@@ -7926,7 +7926,7 @@ _SOKOL_PRIVATE void _sapp_win32_run(const sapp_desc* desc) {
_sapp_d3d11_create_device_and_swapchain();
_sapp_d3d11_create_default_render_target();
#endif
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
_sapp_wgl_init();
_sapp_wgl_load_extensions();
_sapp_wgl_create_context();
@@ -7954,7 +7954,7 @@ _SOKOL_PRIVATE void _sapp_win32_run(const sapp_desc* desc) {
Sleep((DWORD)(16 * _sapp.swap_interval));
}
#endif
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
_sapp_wgl_swap_buffers();
#endif
/* check for window resized, this cannot happen in WM_SIZE as it explodes memory usage */
@@ -10947,7 +10947,7 @@ _SOKOL_PRIVATE void _sapp_x11_process_event(XEvent* event) {
#if !defined(_SAPP_GLX)
_SOKOL_PRIVATE void _sapp_egl_init(void) {
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
if (!eglBindAPI(EGL_OPENGL_API)) {
_SAPP_PANIC(LINUX_EGL_BIND_OPENGL_API_FAILED);
}
@@ -10971,7 +10971,7 @@ _SOKOL_PRIVATE void _sapp_egl_init(void) {
EGLint alpha_size = _sapp.desc.alpha ? 8 : 0;
const EGLint config_attrs[] = {
EGL_SURFACE_TYPE, EGL_WINDOW_BIT,
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
EGL_RENDERABLE_TYPE, EGL_OPENGL_BIT,
#elif defined(SOKOL_GLES3)
EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT,
@@ -11034,7 +11034,7 @@ _SOKOL_PRIVATE void _sapp_egl_init(void) {
}
EGLint ctx_attrs[] = {
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
EGL_CONTEXT_MAJOR_VERSION, _sapp.desc.gl_major_version,
EGL_CONTEXT_MINOR_VERSION, _sapp.desc.gl_minor_version,
EGL_CONTEXT_OPENGL_PROFILE_MASK, EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT,
diff --git a/sokol_gfx.h b/sokol_gfx.h
index 30f0a5b0..27119b35 100644
--- a/sokol_gfx.h
+++ b/sokol_gfx.h
@@ -17,7 +17,7 @@
In the same place define one of the following to select the rendering
backend:
- #define SOKOL_GLCORE33
+ #define SOKOL_GLCORE
#define SOKOL_GLES3
#define SOKOL_D3D11
#define SOKOL_METAL
@@ -29,7 +29,7 @@
#include ...
#include ...
#define SOKOL_IMPL
- #define SOKOL_GLCORE33
+ #define SOKOL_GLCORE
#include "sokol_gfx.h"
The dummy backend replaces the platform-specific backend code with empty
@@ -4229,8 +4229,8 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_
#ifdef SOKOL_GFX_IMPL
#define SOKOL_GFX_IMPL_INCLUDED (1)
-#if !(defined(SOKOL_GLCORE33)||defined(SOKOL_GLES3)||defined(SOKOL_D3D11)||defined(SOKOL_METAL)||defined(SOKOL_WGPU)||defined(SOKOL_DUMMY_BACKEND))
-#error "Please select a backend with SOKOL_GLCORE33, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND"
+#if !(defined(SOKOL_GLCORE)||defined(SOKOL_GLES3)||defined(SOKOL_D3D11)||defined(SOKOL_METAL)||defined(SOKOL_WGPU)||defined(SOKOL_DUMMY_BACKEND))
+#error "Please select a backend with SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND"
#endif
#if defined(SOKOL_MALLOC) || defined(SOKOL_CALLOC) || defined(SOKOL_FREE)
#error "SOKOL_MALLOC/CALLOC/FREE macros are no longer supported, please use sg_desc.allocator to override memory allocation functions"
@@ -4347,13 +4347,13 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_
#if defined(__EMSCRIPTEN__)
#include <emscripten/emscripten.h>
#endif
-#elif defined(SOKOL_GLCORE33) || defined(SOKOL_GLES3)
+#elif defined(SOKOL_GLCORE) || defined(SOKOL_GLES3)
#define _SOKOL_ANY_GL (1)
// include platform specific GL headers (or on Win32: use an embedded GL loader)
#if !defined(SOKOL_EXTERNAL_GL_LOADER)
#if defined(_WIN32)
- #if defined(SOKOL_GLCORE33) && !defined(SOKOL_EXTERNAL_GL_LOADER)
+ #if defined(SOKOL_GLCORE) && !defined(SOKOL_EXTERNAL_GL_LOADER)
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
@@ -4380,7 +4380,7 @@ inline int sg_append_buffer(sg_buffer buf_id, const sg_range& data) { return sg_
#include <GLES3/gl3.h>
#endif
#elif defined(__linux__) || defined(__unix__)
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
#define GL_GLEXT_PROTOTYPES
#include <GL/gl.h>
#else
@@ -7008,7 +7008,7 @@ _SOKOL_PRIVATE GLenum _sg_gl_mag_filter(sg_filter mag_f) {
_SOKOL_PRIVATE GLenum _sg_gl_wrap(sg_wrap w) {
switch (w) {
case SG_WRAP_CLAMP_TO_EDGE: return GL_CLAMP_TO_EDGE;
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
case SG_WRAP_CLAMP_TO_BORDER: return GL_CLAMP_TO_BORDER;
#else
case SG_WRAP_CLAMP_TO_BORDER: return GL_CLAMP_TO_EDGE;
@@ -7453,7 +7453,7 @@ _SOKOL_PRIVATE void _sg_gl_init_limits(void) {
_sg.limits.gl_max_combined_texture_image_units = gl_int;
}
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
_SOKOL_PRIVATE void _sg_gl_init_caps_glcore33(void) {
_sg.backend = SG_BACKEND_GLCORE33;
@@ -7905,7 +7905,7 @@ _SOKOL_PRIVATE void _sg_gl_reset_state_cache(void) {
glEnable(GL_DITHER);
glDisable(GL_POLYGON_OFFSET_FILL);
_sg_stats_add(gl.num_render_state, 10);
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
glEnable(GL_MULTISAMPLE);
glEnable(GL_PROGRAM_POINT_SIZE);
_sg_stats_add(gl.num_render_state, 2);
@@ -7926,7 +7926,7 @@ _SOKOL_PRIVATE void _sg_gl_setup_backend(const sg_desc* desc) {
#if defined(SOKOL_DEBUG)
while (glGetError() != GL_NO_ERROR);
#endif
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
_sg_gl_init_caps_glcore33();
#elif defined(SOKOL_GLES3)
_sg_gl_init_caps_gles3();
@@ -7937,7 +7937,7 @@ _SOKOL_PRIVATE void _sg_gl_setup_backend(const sg_desc* desc) {
_SG_GL_CHECK_ERROR();
// incoming texture data is generally expected to be packed tightly
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
// enable seamless cubemap sampling (only desktop GL)
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
#endif
@@ -8128,7 +8128,7 @@ _SOKOL_PRIVATE sg_resource_state _sg_gl_create_sampler(_sg_sampler_t* smp, const
glSamplerParameteri(smp->gl.smp, GL_TEXTURE_WRAP_S, (GLint)_sg_gl_wrap(smp->cmn.wrap_u));
glSamplerParameteri(smp->gl.smp, GL_TEXTURE_WRAP_T, (GLint)_sg_gl_wrap(smp->cmn.wrap_v));
glSamplerParameteri(smp->gl.smp, GL_TEXTURE_WRAP_R, (GLint)_sg_gl_wrap(smp->cmn.wrap_w));
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
float border[4];
switch (smp->cmn.border_color) {
case SG_BORDERCOLOR_TRANSPARENT_BLACK:
@@ -8612,13 +8612,13 @@ _SOKOL_PRIVATE void _sg_gl_begin_pass(const sg_pass* pass) {
if (atts) {
// offscreen pass
SOKOL_ASSERT(atts->gl.fb);
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
glEnable(GL_FRAMEBUFFER_SRGB);
#endif
glBindFramebuffer(GL_FRAMEBUFFER, atts->gl.fb);
} else {
// default pass
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
glDisable(GL_FRAMEBUFFER_SRGB);
#endif
// NOTE: on some platforms, the default framebuffer of a context
@@ -8918,7 +8918,7 @@ _SOKOL_PRIVATE void _sg_gl_apply_pipeline(_sg_pipeline_t* pip) {
if (pip->gl.color_write_mask[i] != _sg.gl.cache.color_write_mask[i]) {
const sg_color_mask cm = pip->gl.color_write_mask[i];
_sg.gl.cache.color_write_mask[i] = cm;
- #ifdef SOKOL_GLCORE33
+ #ifdef SOKOL_GLCORE
glColorMaski(i,
(cm & SG_COLORMASK_R) != 0,
(cm & SG_COLORMASK_G) != 0,
@@ -8975,7 +8975,7 @@ _SOKOL_PRIVATE void _sg_gl_apply_pipeline(_sg_pipeline_t* pip) {
}
_sg_stats_add(gl.num_render_state, 1);
}
- #ifdef SOKOL_GLCORE33
+ #ifdef SOKOL_GLCORE
if (pip->gl.sample_count != _sg.gl.cache.sample_count) {
_sg.gl.cache.sample_count = pip->gl.sample_count;
if (pip->gl.sample_count > 1) {
@@ -15924,7 +15924,7 @@ _SOKOL_PRIVATE bool _sg_validate_shader_desc(const sg_shader_desc* desc) {
_sg_validate_begin();
_SG_VALIDATE(desc->_start_canary == 0, VALIDATE_SHADERDESC_CANARY);
_SG_VALIDATE(desc->_end_canary == 0, VALIDATE_SHADERDESC_CANARY);
- #if defined(SOKOL_GLCORE33) || defined(SOKOL_GLES3) || defined(SOKOL_WGPU)
+ #if defined(SOKOL_GLCORE) || defined(SOKOL_GLES3) || defined(SOKOL_WGPU)
// on GL or WebGPU, must provide shader source code
_SG_VALIDATE(0 != desc->vs.source, VALIDATE_SHADERDESC_SOURCE);
_SG_VALIDATE(0 != desc->fs.source, VALIDATE_SHADERDESC_SOURCE);
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index cfaf7d46..f2ff0754 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -4,9 +4,9 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 11)
-# SOKOL_GLCORE33, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU, SOKOL_DUMMY
+# SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU, SOKOL_DUMMY
set(SOKOL_BACKEND "SOKOL_DUMMY_BACKEND" CACHE STRING "Select 3D backend API")
-set_property(CACHE SOKOL_BACKEND PROPERTY STRINGS SOKOL_GLCORE33 SOKOL_METAL SOKOL_D3D11 SOKOL_DUMMY_BACKEND)
+set_property(CACHE SOKOL_BACKEND PROPERTY STRINGS SOKOL_GLCORE SOKOL_METAL SOKOL_D3D11 SOKOL_DUMMY_BACKEND)
option(SOKOL_FORCE_EGL "Force EGL with GLCORE33 backend" OFF)
option(SOKOL_FORCE_SLES "Force SLES in sokol-audio Android backend" OFF)
option(USE_ARC "Enable/disable ARC" OFF)
diff --git a/tests/CMakePresets.json b/tests/CMakePresets.json
index fe0b8964..1894497d 100644
--- a/tests/CMakePresets.json
+++ b/tests/CMakePresets.json
@@ -11,7 +11,7 @@
"generator": "Ninja",
"binaryDir": "build/macos_gl_debug",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"CMAKE_BUILD_TYPE": "Debug"
}
},
@@ -20,7 +20,7 @@
"generator": "Ninja",
"binaryDir": "build/macos_gl_release",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"CMAKE_BUILD_TYPE": "Release"
}
},
@@ -29,7 +29,7 @@
"generator": "Ninja",
"binaryDir": "build/macos_gl_analyze",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"CMAKE_BUILD_TYPE": "Debug",
"USE_ANALYZER": {
"type": "BOOL",
@@ -77,7 +77,7 @@
"generator": "Ninja",
"binaryDir": "build/macos_arc_gl_debug",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"USE_ARC": {
"type": "BOOL",
"value": "ON"
@@ -90,7 +90,7 @@
"generator": "Ninja",
"binaryDir": "build/macos_arc_gl_release",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"USE_ARC": {
"type": "BOOL",
"value": "ON"
@@ -103,7 +103,7 @@
"generator": "Ninja",
"binaryDir": "build/macos_arc_gl_analyze",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"USE_ARC": {
"type": "BOOL",
"value": "ON"
@@ -283,7 +283,7 @@
"generator": "Ninja",
"binaryDir": "build/linux_gl_debug",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"CMAKE_BUILD_TYPE": "Debug"
}
},
@@ -292,7 +292,7 @@
"generator": "Ninja",
"binaryDir": "build/linux_gl_release",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"CMAKE_BUILD_TYPE": "Release"
}
},
@@ -301,7 +301,7 @@
"generator": "Ninja",
"binaryDir": "build/linux_gl_analyze",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"CMAKE_BUILD_TYPE": "Debug",
"USE_ANALYZER": {
"type": "BOOL",
@@ -349,7 +349,7 @@
"generator": "Ninja",
"binaryDir": "build/linux_gl_egl_debug",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"SOKOL_FORCE_EGL": {
"type": "BOOL",
"value": "ON"
@@ -362,7 +362,7 @@
"generator": "Ninja",
"binaryDir": "build/linux_gl_egl_release",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"SOKOL_FORCE_EGL": {
"type": "BOOL",
"value": "ON"
@@ -470,7 +470,7 @@
"name": "win_gl",
"binaryDir": "build/win_gl",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33"
+ "SOKOL_BACKEND": "SOKOL_GLCORE"
}
},
{
@@ -478,7 +478,7 @@
"generator": "Ninja",
"binaryDir": "build/win_gl_analyze",
"cacheVariables": {
- "SOKOL_BACKEND": "SOKOL_GLCORE33",
+ "SOKOL_BACKEND": "SOKOL_GLCORE",
"CMAKE_BUILD_TYPE": "Debug",
"USE_ANALYZER": {
"type": "BOOL",
diff --git a/tests/functional/force_dummy_backend.h b/tests/functional/force_dummy_backend.h
index 22390e7d..ac1b6739 100644
--- a/tests/functional/force_dummy_backend.h
+++ b/tests/functional/force_dummy_backend.h
@@ -1,8 +1,8 @@
#if defined(SOKOL_GLES3)
#undef SOKOL_GLES3
#endif
-#if defined(SOKOL_GLCORE33)
-#undef SOKOL_GLCORE33
+#if defined(SOKOL_GLCORE)
+#undef SOKOL_GLCORE
#endif
#if defined(SOKOL_METAL)
#undef SOKOL_METAL
diff --git a/util/sokol_debugtext.h b/util/sokol_debugtext.h
index cec06946..eda40b39 100644
--- a/util/sokol_debugtext.h
+++ b/util/sokol_debugtext.h
@@ -17,7 +17,7 @@
platform-specific embedded shader code (these are the same defines as
used by sokol_gfx.h and sokol_app.h):
- SOKOL_GLCORE33
+ SOKOL_GLCORE
SOKOL_GLES3
SOKOL_D3D11
SOKOL_METAL
@@ -2405,7 +2405,7 @@ static const uint8_t _sdtx_font_oric[2048] = {
@program debugtext vs fs
*/
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
static const char _sdtx_vs_source_glsl330[298] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x6c,0x61,
0x79,0x6f,0x75,0x74,0x28,0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e,0x20,0x3d,0x20,
@@ -3459,7 +3459,7 @@ static const char _sdtx_fs_source_wgsl[663] = {
static const char* _sdtx_vs_src_dummy = "";
static const char* _sdtx_fs_src_dummy = "";
#else
-#error "Please define one of SOKOL_GLCORE33, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
+#error "Please define one of SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
#endif
// ███████ ████████ ██████ ██ ██ ██████ ████████ ███████
@@ -3952,7 +3952,7 @@ static void _sdtx_setup_common(void) {
shd_desc.fs.image_sampler_pairs[0].image_slot = 0;
shd_desc.fs.image_sampler_pairs[0].sampler_slot = 0;
shd_desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp";
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
shd_desc.vs.source = _sdtx_vs_source_glsl330;
shd_desc.fs.source = _sdtx_fs_source_glsl330;
#elif defined(SOKOL_GLES3)
diff --git a/util/sokol_fontstash.h b/util/sokol_fontstash.h
index 048c8215..8e2fef3a 100644
--- a/util/sokol_fontstash.h
+++ b/util/sokol_fontstash.h
@@ -19,7 +19,7 @@
platform-specific embedded shader code (these are the same defines as
used by sokol_gfx.h and sokol_app.h):
- SOKOL_GLCORE33
+ SOKOL_GLCORE
SOKOL_GLES3
SOKOL_D3D11
SOKOL_METAL
@@ -278,7 +278,7 @@ SOKOL_FONTSTASH_API_DECL uint32_t sfons_rgba(uint8_t r, uint8_t g, uint8_t b, ui
#define _SOKOL_UNUSED(x) (void)(x)
#endif
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
/*
Embedded source code compiled with:
@@ -1521,7 +1521,7 @@ static const char _sfons_fs_source_wgsl[674] = {
static const char* _sfons_vs_source_dummy = "";
static const char* _sfons_fs_source_dummy = "";
#else
-#error "Please define one of SOKOL_GLCORE33, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
+#error "Please define one of SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
#endif
typedef struct _sfons_t {
@@ -1601,7 +1601,7 @@ static int _sfons_render_create(void* user_ptr, int width, int height) {
shd_desc.fs.image_sampler_pairs[0].image_slot = 0;
shd_desc.fs.image_sampler_pairs[0].sampler_slot = 0;
shd_desc.label = "sokol-fontstash-shader";
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
shd_desc.vs.source = _sfons_vs_source_glsl330;
shd_desc.fs.source = _sfons_fs_source_glsl330;
#elif defined(SOKOL_GLES3)
diff --git a/util/sokol_gl.h b/util/sokol_gl.h
index 997ddea3..6b1e0174 100644
--- a/util/sokol_gl.h
+++ b/util/sokol_gl.h
@@ -17,7 +17,7 @@
platform-specific embedded shader code (these are the same defines as
used by sokol_gfx.h and sokol_app.h):
- SOKOL_GLCORE33
+ SOKOL_GLCORE
SOKOL_GLES3
SOKOL_D3D11
SOKOL_METAL
@@ -1013,7 +1013,7 @@ inline sgl_pipeline sgl_context_make_pipeline(sgl_context ctx, const sg_pipeline
@program sgl vs fs
*/
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
static const char _sgl_vs_source_glsl330[478] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
@@ -2202,7 +2202,7 @@ static const char _sgl_fs_source_wgsl[647] = {
static const char* _sgl_vs_source_dummy = "";
static const char* _sgl_fs_source_dummy = "";
#else
-#error "Please define one of SOKOL_GLCORE33, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
+#error "Please define one of SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
#endif
// ████████ ██ ██ ██████ ███████ ███████
@@ -3284,7 +3284,7 @@ static void _sgl_setup_common(void) {
shd_desc.fs.image_sampler_pairs[0].sampler_slot = 0;
shd_desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp";
shd_desc.label = "sgl-shader";
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
shd_desc.vs.source = _sgl_vs_source_glsl330;
shd_desc.fs.source = _sgl_fs_source_glsl330;
#elif defined(SOKOL_GLES3)
diff --git a/util/sokol_imgui.h b/util/sokol_imgui.h
index 9c041eaf..6cb1e53a 100644
--- a/util/sokol_imgui.h
+++ b/util/sokol_imgui.h
@@ -26,7 +26,7 @@
platform-specific embedded shader code (these are the same defines as
used by sokol_gfx.h and sokol_app.h):
- SOKOL_GLCORE33
+ SOKOL_GLCORE
SOKOL_GLES3
SOKOL_D3D11
SOKOL_METAL
@@ -721,7 +721,7 @@ static _simgui_state_t _simgui;
@program simgui vs fs
*/
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
static const char _simgui_vs_source_glsl330[341] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
@@ -1838,7 +1838,7 @@ static const char _simgui_fs_source_wgsl[630] = {
static const char* _simgui_vs_source_dummy = "";
static const char* _simgui_fs_source_dummy = "";
#else
-#error "Please define one of SOKOL_GLCORE33, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
+#error "Please define one of SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
#endif
#if !defined(SOKOL_IMGUI_NO_SOKOL_APP)
@@ -2251,7 +2251,7 @@ SOKOL_API_IMPL void simgui_setup(const simgui_desc_t* desc) {
shd_desc.fs.image_sampler_pairs[0].sampler_slot = 0;
shd_desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp";
shd_desc.label = "sokol-imgui-shader";
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
shd_desc.vs.source = _simgui_vs_source_glsl330;
shd_desc.fs.source = _simgui_fs_source_glsl330;
#elif defined(SOKOL_GLES3)
diff --git a/util/sokol_nuklear.h b/util/sokol_nuklear.h
index 04e73eac..9972e133 100644
--- a/util/sokol_nuklear.h
+++ b/util/sokol_nuklear.h
@@ -18,7 +18,7 @@
platform-specific embedded shader code (these are the same defines as
used by sokol_gfx.h and sokol_app.h):
- SOKOL_GLCORE33
+ SOKOL_GLCORE
SOKOL_GLES3
SOKOL_D3D11
SOKOL_METAL
@@ -616,7 +616,7 @@ static _snk_state_t _snuklear;
@program snuk vs fs
*/
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
static const char _snk_vs_source_glsl330[341] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
@@ -1732,7 +1732,7 @@ static const char _snk_fs_source_wgsl[630] = {
static const char* _snk_vs_source_dummy = "";
static const char* _snk_fs_source_dummy = "";
#else
-#error "Please define one of SOKOL_GLCORE33, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
+#error "Please define one of SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
#endif
#if !defined(SOKOL_NUKLEAR_NO_SOKOL_APP)
@@ -2174,7 +2174,7 @@ SOKOL_API_IMPL void snk_setup(const snk_desc_t* desc) {
sg_range fs_bytecode = { .ptr = 0, .size = 0 };
const char* vs_source = 0;
const char* fs_source = 0;
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
vs_source = _snk_vs_source_glsl330;
fs_source = _snk_fs_source_glsl330;
#elif defined(SOKOL_GLES3)
diff --git a/util/sokol_spine.h b/util/sokol_spine.h
index f76d2bf4..2b23209b 100644
--- a/util/sokol_spine.h
+++ b/util/sokol_spine.h
@@ -19,7 +19,7 @@
platform-specific embedded shader code (these are the same defines as
used by sokol_gfx.h and sokol_app.h):
- SOKOL_GLCORE33
+ SOKOL_GLCORE
SOKOL_GLES3
SOKOL_D3D11
SOKOL_METAL
@@ -1472,7 +1472,7 @@ SOKOL_SPINE_API_DECL void sspine_set_skin(sspine_instance instance, sspine_skin
@program sspine vs fs
*/
-#if defined(SOKOL_GLCORE33)
+#if defined(SOKOL_GLCORE)
static const char _sspine_vs_source_glsl330[352] = {
0x23,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x33,0x33,0x30,0x0a,0x0a,0x75,0x6e,
0x69,0x66,0x6f,0x72,0x6d,0x20,0x76,0x65,0x63,0x34,0x20,0x76,0x73,0x5f,0x70,0x61,
@@ -2713,7 +2713,7 @@ static const char _sspine_fs_source_wgsl[1125] = {
static const char* _sspine_vs_source_dummy = "";
static const char* _sspine_fs_source_dummy = "";
#else
-#error "Please define one of SOKOL_GLCORE33, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
+#error "Please define one of SOKOL_GLCORE, SOKOL_GLES3, SOKOL_D3D11, SOKOL_METAL, SOKOL_WGPU or SOKOL_DUMMY_BACKEND!"
#endif
// ███████ ████████ ██████ ██ ██ ██████ ████████ ███████
@@ -4664,7 +4664,7 @@ static void _sspine_init_shared(void) {
shd_desc.fs.image_sampler_pairs[0].sampler_slot = 0;
shd_desc.fs.image_sampler_pairs[0].glsl_name = "tex_smp";
shd_desc.label = "sspine-shader";
- #if defined(SOKOL_GLCORE33)
+ #if defined(SOKOL_GLCORE)
shd_desc.vs.source = _sspine_vs_source_glsl330;
shd_desc.fs.source = _sspine_fs_source_glsl330;
#elif defined(SOKOL_GLES3)