<div dir="ltr"><div><div><div><div>The biggest problem you may have with this is requesting a post 2.1 context in Mac OS X since Apple decided to create a schism in versioning and only supports either 2.1 and below or 3.2 core and above. They do not have ARB_compatibility.<br><br></div>Same with Mesa, meaning that on Linux you can use either 2.1 and below or 3.x core and above if you use the AMDGPU or Intel drivers (AMDGPU-Pro and of course Nvidia drivers support the entire OpenGL).<br><br></div>From a quick look at the source, for Mac OS X only the Cocoa backend supports versioning and for Linux only GTK (Qt doesn't).<br><br></div>Note that there is no explicit way with TOpenGLControl to request the profile, meaning that under GLX (Linux, GTK2) you always get the core profile (as per the GLX_ARB_create_context spec) *unless* you ask for 3.0 or less and you *may* get a compatibility profile you 3.1. With 3.2 you always get core.<br><br></div><div>This is a cross-platform issue since if you specify a post 3.2 or above profile in Windows, Carbon or Qt you do not get a core profile but a compatibility one (in Carbon and Qt you will get a 2.1 profile in some GPU drivers - like AMDGPU and Intel - even if you ask for a 3.2 since the requested version is ignored and these drivers do not support compatibility profiles). This means that if you accidentally use deprecated functionality and you develop under Windows you wont notice it until you try the program under Linux or Mac OS X. Also it can be a performance issue since IIRC Nvidia has said that requesting a core profile will make the driver do extra checks to make sure you are not using deprecated functionality.<br><br></div><div>I think the control should gain a Profile attribute to solve this. And while at it, also a ForwardCompatible attribute for debugging (forward compatible contexts disable any deprecated functionality, but they can also slow down rendering due to extra tests, so they are only good for debugging code).<br></div><div><div><div><div><div><div><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 26, 2017 at 12:51 PM, Michalis Kamburelis <span dir="ltr"><<a href="mailto:michalis.kambi@gmail.com" target="_blank">michalis.kambi@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">2017-05-21 22:38 GMT+02:00 Mathias <<a href="mailto:m_burkhard@gmx.ch">m_burkhard@gmx.ch</a>>:<br>
> Is there an option with Lazarus own board means to activate the OpenGL 3.3<br>
> core mode. Or is it enough for me to do the following?<br>
><br>
> OpenGLControl.<wbr>OpenGLMajorVersion := 3;<br>
> OpenGLControl.<wbr>OpenGLMinorVersion := 3;<br>
><br>
<br>
</span>These TOpenGLControl properties are passed to the underlying API to<br>
indicate that you want a context that supports this specific OpenGL<br>
version. So, yes, this is the way to get OpenGL 3.3 context.<br>
<br>
However, it's not implemented on all platforms. As far as I see, only<br>
the GTK widgetset actually uses the Major/MinorVersion, other<br>
widgetsets simply ignore it.<br>
<br>
But in practice, you will also get a 3.3 context without requesting<br>
it, if your OpenGL supports it, and it has ARB_compatibility. See<br>
<a href="https://www.khronos.org/opengl/wiki/Core_And_Compatibility_in_Contexts" rel="noreferrer" target="_blank">https://www.khronos.org/<wbr>opengl/wiki/Core_And_<wbr>Compatibility_in_Contexts</a><br>
about the gory details.<br>
<br>
Regards,<br>
Michalis<br>
<div class="HOEnZb"><div class="h5">______________________________<wbr>_________________<br>
fpc-devel maillist - <a href="mailto:fpc-devel@lists.freepascal.org">fpc-devel@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel" rel="noreferrer" target="_blank">http://lists.freepascal.org/<wbr>cgi-bin/mailman/listinfo/fpc-<wbr>devel</a><br>
</div></div></blockquote></div><br></div>