Skip to content

WebGL, iOS GLES and desktop GL version from OF_WEBGL_VERSION / OF_GLES_VERSION / OF_GL_VERSION_MAJOR+MINOR defines - #8573

Open
danoli3 wants to merge 6 commits into
openframeworks:masterfrom
danoli3:gl-version-defines
Open

danoli3 wants to merge 6 commits into
openframeworks:masterfrom
danoli3:gl-version-defines

Conversation

@danoli3

@danoli3 danoli3 commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

OpenGL / WebGL version selection

Projects can now choose which graphics version they want without editing openFrameworks core files or main.mm.

The Project Generator provides dropdowns and automatically adds the required define to the generated project.

  • Emscripten / Web: OF_WEBGL_VERSION=1 or 2
    Default: WebGL 2
    • WebGL 1 automatically uses the ES2 Emscripten flags.
    • WebGL 2 uses the existing ES3 flags.
    • Shader setup remains compatible with both.
  • iOS / tvOS: OF_GLES_VERSION=1, 2, or 3
    Default: OpenGL ES 2
    • New projects use the define to select the GLES version.
    • Existing projects that explicitly select ES2 in main.mm keep working unchanged.
  • Desktop: OF_GL_VERSION_MAJOR + OF_GL_VERSION_MINOR
    Default: OpenGL 2.1, unchanged.
    • Example: OF_GL_VERSION_MAJOR=4 and OF_GL_VERSION_MINOR=6 selects OpenGL 4.6.
    • This removes the need for separate GL 3.1–4.5 templates.
    • Both defines must be provided; otherwise the project keeps its existing/default behaviour.

@danoli3 danoli3 changed the title WebGL and iOS GLES version from OF_WEBGL_VERSION / OF_GLES_VERSION defines WebGL, iOS GLES and desktop GL version from OF_WEBGL_VERSION / OF_GLES_VERSION / OF_GL_VERSION_MAJOR+MINOR defines Oct 8, 2026
Define OF_GLES_VERSION for iOS renderer compatibility.
Define OF_GLES_VERSION if not already defined.

@danoli3 danoli3 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Everything will still continue as normal, this just adds more depth to the projectGenerators ability to define OpenGL versions

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