2017-05-26 18:48 GMT+02:00 Kostas Michalopoulos <badsectorac...@gmail.com>: > 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 > glcDefaultProfile, glcPreferCompatibilityProfile, > glcRequireCompatibilityProfile and glcRequireCoreProfile. >
I like all of these ideas:) And they are easily implementable by https://www.khronos.org/registry/OpenGL/extensions/ARB/GLX_ARB_create_context.txt (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:) Regards, Michalis _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel