Skip to content

WebGL, iOS GLES and desktop OpenGL version options; project defines for make builds and VS Debug - #657

Merged
danoli3 merged 3 commits into
openframeworks:masterfrom
danoli3:gl-version-ui
Oct 10, 2026
Merged

danoli3 merged 3 commits into
openframeworks:masterfrom
danoli3:gl-version-ui

Conversation

@danoli3

@danoli3 danoli3 commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Summary

  • WebGL version dropdown (Default / WebGL 1 / WebGL 2) when the emscripten template is selected -> OF_WEBGL_VERSION=1|2
  • OpenGL ES version dropdown (Default / ES 1.1 / ES 2.0 / ES 3.0) for ios / macos -> OF_GLES_VERSION=1|2|3
  • OpenGL version dropdown (Default / 3.1 ... 4.5, 4.6) for desktop platforms (osx, vs, msys2, linux*, vscode) -> OF_GL_VERSION_MAJOR / OF_GL_VERSION_MINOR. Same versions as the gl3.1-gl4.5 templates without needing a separate template; options above 4.1 are hidden when osx is selected (Apple's OpenGL stops at 4.1), 4.6 available for Windows / Linux
  • All three Advanced-only like the renderer field, and only add a define when not left on Default
  • Project defines now reach make builds: addProjectDefine() also records the define and save() writes PROJECT_DEFINES = ... into config.make (replacing the template's # PROJECT_DEFINES = line). Before this, -D / custom defines were dropped for make / VS Code projects since their addDefine() is a no-op
  • VS: project defines (-D, custom defines, renderer + GL options) now go to Debug and Release - addProjectDefine is virtual and visualStudioProject adds to both configs, same as addon defines. Before, they were Release-only so a Debug build silently ignored them
  • Strings for all 9 locales

Notes

  • Needs GL version defines for main templates / PG openFrameworks#8573 for the defines to do anything - OF reads OF_WEBGL_VERSION from PROJECT_DEFINES for the emscripten link flags + context version, and OF_GLES_VERSION in the ios + tvOS template main.mm, and OF_GL_VERSION_MAJOR/MINOR in the desktop template main.cpp (settings.setGLVersion). Without it the defines are harmless
  • Updating a project with no defines still resets config.make from the template (existing behaviour, a backup is written), so PROJECT_DEFINES needs re-selecting on update

Test plan

  • Built commandLine (xcodebuild, macOS 12 target) and generated against a real OF checkout:
    • -posx -temscripten -DOF_WEBGL_VERSION=1,MY_FLAG -> PROJECT_DEFINES = OF_WEBGL_VERSION=1 MY_FLAG in config.make
    • re-run with -DOF_WEBGL_VERSION=2 replaces it (single line)
    • -pios -DOF_GLES_VERSION=3 -> OF_GLES_VERSION=3 in both Xcode build configs
    • -posx with no defines -> config.make unchanged
    • -pvs -DOF_GL_VERSION_MAJOR=4,OF_GL_VERSION_MINOR=6 -> both the Debug and Release ItemDefinitionGroups (per-arch groups have no own PreprocessorDefinitions, so x64 / ARM64 / ARM64EC all inherit)
    • -posx -DOF_GL_VERSION_MAJOR=4,OF_GL_VERSION_MINOR=1 -> both Xcode build configs
  • Live Electron: WebGL field shows only with the emscripten template, GLES only for ios, OpenGL for vs (to 4.6) / osx (capped at 4.1, a 4.6 pick resets to Default), all hidden with Advanced off

@danoli3 danoli3 changed the title WebGL and iOS GLES version options; write project defines to config.make WebGL, iOS GLES and desktop OpenGL version options; project defines for make builds and VS Debug Oct 8, 2026
@danoli3
danoli3 merged commit 0c07dba into openframeworks:master Oct 10, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant