<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 21.08.2017 14:59, Robert Osfield
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAFN7Y+WZertZ-SwfWkm21Uw6RYKpA6ZhqedWup_HBrrZCcMrdw@mail.gmail.com">
<div dir="ltr">Hi Sandro,<br>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 21 August 2017 at 13:21, Sandro
Mani <span dir="ltr"><<a
href="mailto:manisandro@gmail.com" target="_blank"
moz-do-not-send="true">manisandro@gmail.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF"><span class=""></span>A
less invasive alternative could be to introduce a new
singleton called OpenGLSettings or similar which
contains just the three settings glContextVersion,
glContextFlags, glContextProfileMask.<br>
</div>
</blockquote>
<div><br>
</div>
<div>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.<br>
</div>
</div>
</div>
</div>
</blockquote>
Mh yeah my quick reaction was just that as opposed to other fields
in the DisplaySettings, the desired OpenGL context version is likely
to be a constant thoughout the lifetime of the application.<br>
<blockquote type="cite"
cite="mid:CAFN7Y+WZertZ-SwfWkm21Uw6RYKpA6ZhqedWup_HBrrZCcMrdw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div><br>
--<br>
<br>
</div>
<div>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.<br>
<br>
</div>
<div>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.<br>
</div>
</div>
</div>
</div>
</blockquote>
Admittedly, I'm not very familiar with OpenSceneGraph, my main
motivation digging into this is just to get osgEarth working again
under Linux, as it has been broken for the past couple of years ever
since it started requiring GLSL330+.<br>
<br>
That said, I found it confusing and it took me some time to figure
out how to actually set the glContextVersion etc. The
DisplaySettings had no effect, and only after digging into the code
I realized that it was because osgEarth creates its version without
specifying a DisplaySettings instance [1]. After becoming more
familiar with the internal workings, I suppose this can be
classified as a bug in osgEarth, but I feel that a user new to OSG
could expect that the settings specified in the global
DisplaySettings singleton actually have an effect on the Traits if
it is constructed without a specific ds instance passed.<br>
<br>
<br>
Just my thoughts.<br>
<br>
Sandro<br>
<br>
[1]
<a class="moz-txt-link-freetext" href="https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/Capabilities.cpp">https://github.com/gwaldron/osgearth/blob/master/src/osgEarth/Capabilities.cpp</a><br>
</body>
</html>