[osg-users] Specifying the GL context version to request

Robert Osfield robert.osfield at gmail.com
Mon Aug 21 05:59:51 PDT 2017


Hi Sandro,

On 21 August 2017 at 13:21, Sandro Mani <manisandro at gmail.com> wrote:

> A less invasive alternative could be to introduce a new singleton called
> OpenGLSettings or similar which contains just the three settings
> glContextVersion, glContextFlags, glContextProfileMask.
>

I don't see how this is different, if you are setting setting a default
that users might not realize is now being set differently, it's just the
same issue expressed in a slightly different way.

--

Currently when the osgViewer::Viewer is constructed and run() is called
without the viewer explictly setting up the graphics context it's fallback
to using the setUpViewAcrossAllScreens() and within this implementation
when it sets up the Traits it passes the DisplaySetting assigned to the
Viewer or DisplaySetting::instance() will be used if none is assigned.
This fallback is functionally the same as you are after and this already
will be working.

For places where the windows are being explicitly set up then they will be
creating a Traits themselves and at this point I'm happy for them to need
to explicitly specify the settings or pass in the DisplaySettings they want
to use as defaults.

--

The only area that I think we might need to tighten up is with the defaults
if the user explicitly builds the OSG against GL3 without any compatibility
with GL1/GL2, here it would make sense for the
GraphicsContext::Traits::glVersion to be set to 3.0 rather than 1.0 that it
defaults to right now.  One could push this into DisplaySettings's defaults
and then force GraphicsContext::Traits to fallback to this by default, but
personally I'm not happy with this in case it brings in other defaults that
aren't intended.


Robert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170821/1e437c74/attachment.htm>


More information about the osg-users mailing list