Skip to content

Remove legacy OpenGL fallback definitions#599

Draft
tritao wants to merge 1 commit into
coin3d:masterfrom
tritao:pr/modern-gl/002-legacy-gl-defs
Draft

Remove legacy OpenGL fallback definitions#599
tritao wants to merge 1 commit into
coin3d:masterfrom
tritao:pr/modern-gl/002-legacy-gl-defs

Conversation

@tritao

@tritao tritao commented Jan 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove the bundled legacy OpenGL fallback enums/macros and adjust a few call sites accordingly.

Why

include/Inventor/system/gl.h had accumulated a large set of OpenGL/extension fallback definitions for very old headers. Keeping those in-tree increases maintenance and can hide portability problems by making missing symbols “appear” at compile time.

Changes

  • Slim include/Inventor/system/gl.h down to a small wrapper that defers to Inventor/system/gl-headers.h.
  • Update a handful of OpenGL-related sources to use the proper enum/extension names without relying on the removed fallback definitions.

Commits

  • 07e361d208: GL: add enum fallbacks for legacy headers

@tritao tritao marked this pull request as draft January 27, 2026 12:38
@tritao tritao force-pushed the pr/modern-gl/002-legacy-gl-defs branch 10 times, most recently from 81a47f2 to 07e361d Compare January 27, 2026 16:35
Some build environments still provide very old OpenGL/GLU/WGL headers where many enums are missing unless extension headers are available and included.

Add a small fallback header (Inventor/system/gl-fallbacks.h) with known-missing enum values and include it from the central GL header wrapper.
@tritao tritao force-pushed the pr/modern-gl/002-legacy-gl-defs branch from 07e361d to 3d8101c Compare January 27, 2026 16:35
@tritao

tritao commented Jan 28, 2026

Copy link
Copy Markdown
Contributor Author

This PR ended up a bit different than the original version, but before I complete it so it's ready for review, maybe it's worth having an initial discussion.

In a branch I've been working on, I end up adding support for the GLAD extension loader, which turns out some of this work obsolete, as it can fully replace the incomplete platform-specific headers and legacy fallbacks in the existing code or in this branch.

Do you think replacing the existing legacy OpenGL definitions with GLAD (https://glad.dav1d.de/) is an acceptable path going forward? @VolkerEnderlein

@WizzerWorks

Copy link
Copy Markdown
Contributor

There are also these links for reference:

@VolkerEnderlein

Copy link
Copy Markdown
Member

I just had a closer look onto GLAD, it looks well suited for the job. That path looks very promising.

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.

3 participants