From b032d75b3cede446cec11aae0b8a55ed2776b108 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Tue, 6 Oct 2026 21:19:48 +1100 Subject: [PATCH 1/6] WebGL and iOS GLES version from OF_WEBGL_VERSION / OF_GLES_VERSION defines --- addons/ofxEmscripten/src/ofxAppEmscriptenWindow.cpp | 6 +++++- addons/ofxiOS/src/app/ofAppiOSWindow.h | 4 ++-- addons/ofxiOS/src/ofxiOSConstants.h | 5 +++++ .../project/emscripten/config.emscripten.default.mk | 5 +++++ scripts/templates/ios/src/main.mm | 2 +- scripts/templates/tvOS/src/main.mm | 2 +- 6 files changed, 19 insertions(+), 5 deletions(-) diff --git a/addons/ofxEmscripten/src/ofxAppEmscriptenWindow.cpp b/addons/ofxEmscripten/src/ofxAppEmscriptenWindow.cpp index be3f9d663cf..d67de5826c2 100644 --- a/addons/ofxEmscripten/src/ofxAppEmscriptenWindow.cpp +++ b/addons/ofxEmscripten/src/ofxAppEmscriptenWindow.cpp @@ -10,6 +10,10 @@ #include "ofEvents.h" #include "ofGLProgrammableRenderer.h" +#ifndef OF_WEBGL_VERSION +#define OF_WEBGL_VERSION 2 +#endif + using namespace std; ofxAppEmscriptenWindow * ofxAppEmscriptenWindow::instance = NULL; @@ -38,7 +42,7 @@ void ofxAppEmscriptenWindow::setup(const ofGLESWindowSettings & settings){ attrs.depth = 1; attrs.stencil = 1; attrs.antialias = 1; - attrs.majorVersion = 2; + attrs.majorVersion = OF_WEBGL_VERSION; attrs.minorVersion = 0; attrs.alpha = 0; diff --git a/addons/ofxiOS/src/app/ofAppiOSWindow.h b/addons/ofxiOS/src/app/ofAppiOSWindow.h index 15ffecb469f..26dd0a999b4 100644 --- a/addons/ofxiOS/src/app/ofAppiOSWindow.h +++ b/addons/ofxiOS/src/app/ofAppiOSWindow.h @@ -55,7 +55,7 @@ class ofiOSWindowSettings: public ofGLESWindowSettings{ ,enableMultiTouch(false) { windowMode = OF_FULLSCREEN; setupOrientation = OF_ORIENTATION_DEFAULT; - glesVersion = 2; + glesVersion = OF_GLES_VERSION; } ofiOSWindowSettings(const ofWindowSettings & settings) @@ -77,7 +77,7 @@ class ofiOSWindowSettings: public ofGLESWindowSettings{ if(glesSettings){ glesVersion = glesSettings->glesVersion; } else { - glesVersion = 2; + glesVersion = OF_GLES_VERSION; } const ofiOSWindowSettings * iosSettings = dynamic_cast(&settings); if(iosSettings){ diff --git a/addons/ofxiOS/src/ofxiOSConstants.h b/addons/ofxiOS/src/ofxiOSConstants.h index 516c04519be..467e57652a0 100644 --- a/addons/ofxiOS/src/ofxiOSConstants.h +++ b/addons/ofxiOS/src/ofxiOSConstants.h @@ -68,6 +68,11 @@ enum ofxiOSRendererType { OFXIOS_RENDERER_METAL = 4 }; +// default GLES version - set OF_GLES_VERSION=1|2|3 in the project defines to override +#ifndef OF_GLES_VERSION +#define OF_GLES_VERSION OFXIOS_RENDERER_ES2 +#endif + enum ofxiOSWindowControllerType{ CORE_ANIMATION = 1, GL_KIT = 2, diff --git a/libs/openFrameworksCompiled/project/emscripten/config.emscripten.default.mk b/libs/openFrameworksCompiled/project/emscripten/config.emscripten.default.mk index 1c633c942da..9cda101fb32 100644 --- a/libs/openFrameworksCompiled/project/emscripten/config.emscripten.default.mk +++ b/libs/openFrameworksCompiled/project/emscripten/config.emscripten.default.mk @@ -124,7 +124,12 @@ ifneq ($(strip $(wildcard bin/data/*)),) PLATFORM_LDFLAGS += --preload-file bin/data@data endif PLATFORM_LDFLAGS += --use-port=emdawnwebgpu +# PROJECT_DEFINES += OF_WEBGL_VERSION=1 in config.make for a WebGL 1 only build (default WebGL 2) +ifneq ($(filter OF_WEBGL_VERSION=1,$(PROJECT_DEFINES)),) +PLATFORM_LDFLAGS += -s MAX_WEBGL_VERSION=1 -s FULL_ES2 +else PLATFORM_LDFLAGS += -s MAX_WEBGL_VERSION=2 -s WEBGL2_BACKWARDS_COMPATIBILITY_EMULATION=1 -s FULL_ES3 +endif PLATFORM_LDFLAGS += -s AUTO_NATIVE_LIBRARIES=1 PLATFORM_LDFLAGS += -s AUTO_JS_LIBRARIES=1 diff --git a/scripts/templates/ios/src/main.mm b/scripts/templates/ios/src/main.mm index 4aa96717b78..32943e1734c 100644 --- a/scripts/templates/ios/src/main.mm +++ b/scripts/templates/ios/src/main.mm @@ -11,7 +11,7 @@ int main() { settings.numOfAntiAliasingSamples = 0; // number of samples used for anti-aliasing. settings.enableHardwareOrientation = false; // enables native view orientation. settings.enableHardwareOrientationAnimation = false; // enables native orientation changes to be animated. - settings.glesVersion = OFXIOS_RENDERER_ES2; // type of renderer to use, ES1, ES2, ES3 + settings.glesVersion = OF_GLES_VERSION; // type of renderer to use, ES1, ES2, ES3 - default ES2, set via OF_GLES_VERSION define settings.windowControllerType = ofxiOSWindowControllerType::GL_KIT; // Window Controller Type settings.colorType = ofxiOSRendererColorFormat::RGBA8888; // color format used default RGBA8888 settings.depthType = ofxiOSRendererDepthFormat::DEPTH_NONE; // depth format (16/24) if depth enabled diff --git a/scripts/templates/tvOS/src/main.mm b/scripts/templates/tvOS/src/main.mm index 7a44a4c64df..58a0b706a30 100644 --- a/scripts/templates/tvOS/src/main.mm +++ b/scripts/templates/tvOS/src/main.mm @@ -11,7 +11,7 @@ int main() { settings.numOfAntiAliasingSamples = 0; // number of samples used for anti-aliasing. settings.enableHardwareOrientation = false; // enables native view orientation. settings.enableHardwareOrientationAnimation = false; // enables native orientation changes to be animated. - settings.glesVersion = OFXIOS_RENDERER_ES2; // type of renderer to use, ES1, ES2, ES3 + settings.glesVersion = OF_GLES_VERSION; // type of renderer to use, ES1, ES2, ES3 - default ES2, set via OF_GLES_VERSION define settings.windowControllerType = ofxiOSWindowControllerType::GL_KIT; // Window Controller Type settings.colorType = ofxiOSRendererColorFormat::RGBA8888; // color format used default RGBA8888 settings.depthType = ofxiOSRendererDepthFormat::DEPTH_NONE; // depth format (16/24) if depth enabled From 0020f6b23c633d6b8421e5eb65c8e5d0785ffa4f Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Thu, 8 Oct 2026 22:23:45 +1300 Subject: [PATCH 2/6] Desktop GL version from OF_GL_VERSION_MAJOR / MINOR in templates; keep iOS GLES define to template main.mm --- addons/ofxiOS/src/app/ofAppiOSWindow.h | 4 ++-- addons/ofxiOS/src/ofxiOSConstants.h | 2 +- scripts/templates/linux/src/main.cpp | 4 ++++ scripts/templates/linux64/src/main.cpp | 4 ++++ scripts/templates/linuxarmv6l/src/main.cpp | 4 ++++ scripts/templates/linuxarmv7l/src/main.cpp | 4 ++++ scripts/templates/msys2/src/main.cpp | 4 ++++ scripts/templates/osx/src/main.cpp | 4 ++++ scripts/templates/vs/src/main.cpp | 4 ++++ scripts/templates/vs2019/src/main.cpp | 4 ++++ scripts/templates/vs2026/src/main.cpp | 4 ++++ scripts/templates/vscode/src/main.cpp | 4 ++++ 12 files changed, 43 insertions(+), 3 deletions(-) diff --git a/addons/ofxiOS/src/app/ofAppiOSWindow.h b/addons/ofxiOS/src/app/ofAppiOSWindow.h index 26dd0a999b4..15ffecb469f 100644 --- a/addons/ofxiOS/src/app/ofAppiOSWindow.h +++ b/addons/ofxiOS/src/app/ofAppiOSWindow.h @@ -55,7 +55,7 @@ class ofiOSWindowSettings: public ofGLESWindowSettings{ ,enableMultiTouch(false) { windowMode = OF_FULLSCREEN; setupOrientation = OF_ORIENTATION_DEFAULT; - glesVersion = OF_GLES_VERSION; + glesVersion = 2; } ofiOSWindowSettings(const ofWindowSettings & settings) @@ -77,7 +77,7 @@ class ofiOSWindowSettings: public ofGLESWindowSettings{ if(glesSettings){ glesVersion = glesSettings->glesVersion; } else { - glesVersion = OF_GLES_VERSION; + glesVersion = 2; } const ofiOSWindowSettings * iosSettings = dynamic_cast(&settings); if(iosSettings){ diff --git a/addons/ofxiOS/src/ofxiOSConstants.h b/addons/ofxiOS/src/ofxiOSConstants.h index 467e57652a0..315c829aadd 100644 --- a/addons/ofxiOS/src/ofxiOSConstants.h +++ b/addons/ofxiOS/src/ofxiOSConstants.h @@ -68,7 +68,7 @@ enum ofxiOSRendererType { OFXIOS_RENDERER_METAL = 4 }; -// default GLES version - set OF_GLES_VERSION=1|2|3 in the project defines to override +// template main.mm GLES version - set OF_GLES_VERSION=1|2|3 in the project defines to override #ifndef OF_GLES_VERSION #define OF_GLES_VERSION OFXIOS_RENDERER_ES2 #endif diff --git a/scripts/templates/linux/src/main.cpp b/scripts/templates/linux/src/main.cpp index 4e6518d49dc..e8fffe57f29 100644 --- a/scripts/templates/linux/src/main.cpp +++ b/scripts/templates/linux/src/main.cpp @@ -9,6 +9,10 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN +#ifdef OF_GL_VERSION_MAJOR + settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version +#endif + auto window = ofCreateWindow(settings); ofRunApp(window, std::make_shared()); diff --git a/scripts/templates/linux64/src/main.cpp b/scripts/templates/linux64/src/main.cpp index 4e6518d49dc..e8fffe57f29 100644 --- a/scripts/templates/linux64/src/main.cpp +++ b/scripts/templates/linux64/src/main.cpp @@ -9,6 +9,10 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN +#ifdef OF_GL_VERSION_MAJOR + settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version +#endif + auto window = ofCreateWindow(settings); ofRunApp(window, std::make_shared()); diff --git a/scripts/templates/linuxarmv6l/src/main.cpp b/scripts/templates/linuxarmv6l/src/main.cpp index 4e6518d49dc..e8fffe57f29 100644 --- a/scripts/templates/linuxarmv6l/src/main.cpp +++ b/scripts/templates/linuxarmv6l/src/main.cpp @@ -9,6 +9,10 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN +#ifdef OF_GL_VERSION_MAJOR + settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version +#endif + auto window = ofCreateWindow(settings); ofRunApp(window, std::make_shared()); diff --git a/scripts/templates/linuxarmv7l/src/main.cpp b/scripts/templates/linuxarmv7l/src/main.cpp index 4e6518d49dc..e8fffe57f29 100644 --- a/scripts/templates/linuxarmv7l/src/main.cpp +++ b/scripts/templates/linuxarmv7l/src/main.cpp @@ -9,6 +9,10 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN +#ifdef OF_GL_VERSION_MAJOR + settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version +#endif + auto window = ofCreateWindow(settings); ofRunApp(window, std::make_shared()); diff --git a/scripts/templates/msys2/src/main.cpp b/scripts/templates/msys2/src/main.cpp index 4e6518d49dc..e8fffe57f29 100644 --- a/scripts/templates/msys2/src/main.cpp +++ b/scripts/templates/msys2/src/main.cpp @@ -9,6 +9,10 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN +#ifdef OF_GL_VERSION_MAJOR + settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version +#endif + auto window = ofCreateWindow(settings); ofRunApp(window, std::make_shared()); diff --git a/scripts/templates/osx/src/main.cpp b/scripts/templates/osx/src/main.cpp index 4e6518d49dc..e8fffe57f29 100644 --- a/scripts/templates/osx/src/main.cpp +++ b/scripts/templates/osx/src/main.cpp @@ -9,6 +9,10 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN +#ifdef OF_GL_VERSION_MAJOR + settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version +#endif + auto window = ofCreateWindow(settings); ofRunApp(window, std::make_shared()); diff --git a/scripts/templates/vs/src/main.cpp b/scripts/templates/vs/src/main.cpp index 4e6518d49dc..e8fffe57f29 100644 --- a/scripts/templates/vs/src/main.cpp +++ b/scripts/templates/vs/src/main.cpp @@ -9,6 +9,10 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN +#ifdef OF_GL_VERSION_MAJOR + settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version +#endif + auto window = ofCreateWindow(settings); ofRunApp(window, std::make_shared()); diff --git a/scripts/templates/vs2019/src/main.cpp b/scripts/templates/vs2019/src/main.cpp index 4e6518d49dc..e8fffe57f29 100644 --- a/scripts/templates/vs2019/src/main.cpp +++ b/scripts/templates/vs2019/src/main.cpp @@ -9,6 +9,10 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN +#ifdef OF_GL_VERSION_MAJOR + settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version +#endif + auto window = ofCreateWindow(settings); ofRunApp(window, std::make_shared()); diff --git a/scripts/templates/vs2026/src/main.cpp b/scripts/templates/vs2026/src/main.cpp index 4e6518d49dc..e8fffe57f29 100644 --- a/scripts/templates/vs2026/src/main.cpp +++ b/scripts/templates/vs2026/src/main.cpp @@ -9,6 +9,10 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN +#ifdef OF_GL_VERSION_MAJOR + settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version +#endif + auto window = ofCreateWindow(settings); ofRunApp(window, std::make_shared()); diff --git a/scripts/templates/vscode/src/main.cpp b/scripts/templates/vscode/src/main.cpp index 4e6518d49dc..e8fffe57f29 100644 --- a/scripts/templates/vscode/src/main.cpp +++ b/scripts/templates/vscode/src/main.cpp @@ -9,6 +9,10 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN +#ifdef OF_GL_VERSION_MAJOR + settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version +#endif + auto window = ofCreateWindow(settings); ofRunApp(window, std::make_shared()); From 27fab192d8e49c473e78e891891a865a5154e877 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 9 Oct 2026 11:17:43 +1300 Subject: [PATCH 3/6] Only set GL version when both OF_GL_VERSION_MAJOR and OF_GL_VERSION_MINOR are defined --- scripts/templates/linux/src/main.cpp | 2 +- scripts/templates/linux64/src/main.cpp | 2 +- scripts/templates/linuxarmv6l/src/main.cpp | 2 +- scripts/templates/linuxarmv7l/src/main.cpp | 2 +- scripts/templates/msys2/src/main.cpp | 2 +- scripts/templates/osx/src/main.cpp | 2 +- scripts/templates/vs/src/main.cpp | 2 +- scripts/templates/vs2019/src/main.cpp | 2 +- scripts/templates/vs2026/src/main.cpp | 2 +- scripts/templates/vscode/src/main.cpp | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/templates/linux/src/main.cpp b/scripts/templates/linux/src/main.cpp index e8fffe57f29..9b9203fcad7 100644 --- a/scripts/templates/linux/src/main.cpp +++ b/scripts/templates/linux/src/main.cpp @@ -9,7 +9,7 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN -#ifdef OF_GL_VERSION_MAJOR +#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR) settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version #endif diff --git a/scripts/templates/linux64/src/main.cpp b/scripts/templates/linux64/src/main.cpp index e8fffe57f29..9b9203fcad7 100644 --- a/scripts/templates/linux64/src/main.cpp +++ b/scripts/templates/linux64/src/main.cpp @@ -9,7 +9,7 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN -#ifdef OF_GL_VERSION_MAJOR +#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR) settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version #endif diff --git a/scripts/templates/linuxarmv6l/src/main.cpp b/scripts/templates/linuxarmv6l/src/main.cpp index e8fffe57f29..9b9203fcad7 100644 --- a/scripts/templates/linuxarmv6l/src/main.cpp +++ b/scripts/templates/linuxarmv6l/src/main.cpp @@ -9,7 +9,7 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN -#ifdef OF_GL_VERSION_MAJOR +#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR) settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version #endif diff --git a/scripts/templates/linuxarmv7l/src/main.cpp b/scripts/templates/linuxarmv7l/src/main.cpp index e8fffe57f29..9b9203fcad7 100644 --- a/scripts/templates/linuxarmv7l/src/main.cpp +++ b/scripts/templates/linuxarmv7l/src/main.cpp @@ -9,7 +9,7 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN -#ifdef OF_GL_VERSION_MAJOR +#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR) settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version #endif diff --git a/scripts/templates/msys2/src/main.cpp b/scripts/templates/msys2/src/main.cpp index e8fffe57f29..9b9203fcad7 100644 --- a/scripts/templates/msys2/src/main.cpp +++ b/scripts/templates/msys2/src/main.cpp @@ -9,7 +9,7 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN -#ifdef OF_GL_VERSION_MAJOR +#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR) settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version #endif diff --git a/scripts/templates/osx/src/main.cpp b/scripts/templates/osx/src/main.cpp index e8fffe57f29..9b9203fcad7 100644 --- a/scripts/templates/osx/src/main.cpp +++ b/scripts/templates/osx/src/main.cpp @@ -9,7 +9,7 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN -#ifdef OF_GL_VERSION_MAJOR +#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR) settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version #endif diff --git a/scripts/templates/vs/src/main.cpp b/scripts/templates/vs/src/main.cpp index e8fffe57f29..9b9203fcad7 100644 --- a/scripts/templates/vs/src/main.cpp +++ b/scripts/templates/vs/src/main.cpp @@ -9,7 +9,7 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN -#ifdef OF_GL_VERSION_MAJOR +#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR) settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version #endif diff --git a/scripts/templates/vs2019/src/main.cpp b/scripts/templates/vs2019/src/main.cpp index e8fffe57f29..9b9203fcad7 100644 --- a/scripts/templates/vs2019/src/main.cpp +++ b/scripts/templates/vs2019/src/main.cpp @@ -9,7 +9,7 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN -#ifdef OF_GL_VERSION_MAJOR +#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR) settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version #endif diff --git a/scripts/templates/vs2026/src/main.cpp b/scripts/templates/vs2026/src/main.cpp index e8fffe57f29..9b9203fcad7 100644 --- a/scripts/templates/vs2026/src/main.cpp +++ b/scripts/templates/vs2026/src/main.cpp @@ -9,7 +9,7 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN -#ifdef OF_GL_VERSION_MAJOR +#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR) settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version #endif diff --git a/scripts/templates/vscode/src/main.cpp b/scripts/templates/vscode/src/main.cpp index e8fffe57f29..9b9203fcad7 100644 --- a/scripts/templates/vscode/src/main.cpp +++ b/scripts/templates/vscode/src/main.cpp @@ -9,7 +9,7 @@ int main( ){ settings.setSize(1024, 768); settings.windowMode = OF_WINDOW; //can also be OF_FULLSCREEN -#ifdef OF_GL_VERSION_MAJOR +#if defined(OF_GL_VERSION_MAJOR) && defined(OF_GL_VERSION_MINOR) settings.setGLVersion(OF_GL_VERSION_MAJOR, OF_GL_VERSION_MINOR); // set via projectGenerator OpenGL version #endif From 535897f205aada8f473f685c39821de5680be9fd Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 9 Oct 2026 12:05:34 +1300 Subject: [PATCH 4/6] Update ofxiOSConstants.h --- addons/ofxiOS/src/ofxiOSConstants.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/ofxiOS/src/ofxiOSConstants.h b/addons/ofxiOS/src/ofxiOSConstants.h index 315c829aadd..7f81073f79b 100644 --- a/addons/ofxiOS/src/ofxiOSConstants.h +++ b/addons/ofxiOS/src/ofxiOSConstants.h @@ -68,7 +68,7 @@ enum ofxiOSRendererType { OFXIOS_RENDERER_METAL = 4 }; -// template main.mm GLES version - set OF_GLES_VERSION=1|2|3 in the project defines to override +// OF_GLES_VERSION=1|2|3 in the project defines to override or in projectGenerator from 0.99.0 #ifndef OF_GLES_VERSION #define OF_GLES_VERSION OFXIOS_RENDERER_ES2 #endif From b0b16e57eb023cfc5dd9bf6d288a404d8036c0b9 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 9 Oct 2026 12:06:49 +1300 Subject: [PATCH 5/6] Add OF_GLES_VERSION definition in main.mm Define OF_GLES_VERSION for iOS renderer compatibility. --- scripts/templates/ios/src/main.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/templates/ios/src/main.mm b/scripts/templates/ios/src/main.mm index 32943e1734c..b4d84d3eb4b 100644 --- a/scripts/templates/ios/src/main.mm +++ b/scripts/templates/ios/src/main.mm @@ -1,5 +1,9 @@ #include "ofApp.h" +#ifndef OF_GLES_VERSION +#define OF_GLES_VERSION OFXIOS_RENDERER_ES2 +#endif + int main() { // here are the most commonly used iOS window settings. From 65f11489ef331179ed31f443f3a2beff2a554380 Mon Sep 17 00:00:00 2001 From: Dan Rosser Date: Fri, 9 Oct 2026 12:07:39 +1300 Subject: [PATCH 6/6] Add GLES version definition for tvOS Define OF_GLES_VERSION if not already defined. --- scripts/templates/tvOS/src/main.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/templates/tvOS/src/main.mm b/scripts/templates/tvOS/src/main.mm index 58a0b706a30..56c8bd89054 100644 --- a/scripts/templates/tvOS/src/main.mm +++ b/scripts/templates/tvOS/src/main.mm @@ -1,5 +1,9 @@ #include "ofApp.h" +#ifndef OF_GLES_VERSION +#define OF_GLES_VERSION OFXIOS_RENDERER_ES2 +#endif + int main() { // here are the most commonly used iOS window settings.