Post by Kostas Michalopoulos
I'd use an enum with values like (glcDefaultProfile, glcCoreProfile,
glcCompatibilityProfile). Default would leave things as-is (when versioning
is introduced to backends that currently do not support it, it will either
use a backend-specific default or leave it unspecified where possible), Core
will explicitly request a core profile and Compatibility will explicitly
request a compatibility profile. Under OSes where compatibility isn't
available, the context creation would fail.
For bonus points, i'd rename glcCoreProfile to glcRequireCoreProfile and
instead of glcCompatibilityProfile i'd use glcPreferCompatibilityProfile and
glcRequireCompatibilityProfile. glcRequireCoreProfile would work like above,
glcPreferCompatibilityProfile will first try to use the compatibility
profile but fallback to core if not available (so that the drivers avoid the
extra checks) and glcRequireCompatibilityProfile will fail if the
compatibility profile doesn't exist - basically having the profiles as
glcRequireCompatibilityProfile and glcRequireCoreProfile.
I like all of these ideas:)
And they are easily implementable by
(used by the GTK implementation):
- glcRequireCoreProfile and glcRequireCompatibilityProfile results in
the appropriate bit set of GLX_CONTEXT_PROFILE_MASK_ARB .
- glcPreferCompatibilityProfile would need to eventually query for
another profile, as you write (I'm not sure do we really need it much?
I see that sometimes it can be useful, if the implementation can adapt
to use either "old fixed-function renderer" or not, but I'm not sure
is this a large need.)
- ForwardCompatible = true sets the
GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB bit in GLX_CONTEXT_FLAGS_ARB .
Not that I'm volunteering to implement them (I'm not having much time,
and I mostly use my own OpenGL context creation in CastleWindow). But
it makes sense and I would gladly test it:)
fpc-devel maillist - email@example.com