https://wiki.freepascal.org/index.php?title=Extending_TOpenGLControl&feed=atom&action=historyExtending TOpenGLControl - Revision history2024-03-29T05:15:19ZRevision history for this page on the wikiMediaWiki 1.35.6https://wiki.freepascal.org/index.php?title=Extending_TOpenGLControl&diff=83102&oldid=prevSkalogryz: categories2014-09-18T03:17:37Z<p>categories</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 03:17, 18 September 2014</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l20" >Line 20:</td>
<td colspan="2" class="diff-lineno">Line 20:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>I hope this information helps anyone willing to create a patch :) The job is fairly easy, you can grep e.g. for AlphaBits inside lazarus/trunk/components/opengl/ to see where you need to insert your code. You basically pass down the information to appropriate WGL/GLX routines.</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>I hope this information helps anyone willing to create a patch :) The job is fairly easy, you can grep e.g. for AlphaBits inside lazarus/trunk/components/opengl/ to see where you need to insert your code. You basically pass down the information to appropriate WGL/GLX routines.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:Graphics]]</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Category:OpenGL]]</ins></div></td></tr>
</table>Skalogryzhttps://wiki.freepascal.org/index.php?title=Extending_TOpenGLControl&diff=59422&oldid=prevMichalis: Fix WGL_AUX_BUFFERS_ARB name.2012-06-07T18:05:54Z<p>Fix WGL_AUX_BUFFERS_ARB name.</p>
<table class="diff diff-contentalign-left diff-editfont-monospace" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:05, 7 June 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l12" >Line 12:</td>
<td colspan="2" class="diff-lineno">Line 12:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>2. For WGL (WinAPI), also two ways of choosing context attributes are available, for similar reasons (the modern way has more features, but the older way is 100% universally supported):</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>2. For WGL (WinAPI), also two ways of choosing context attributes are available, for similar reasons (the modern way has more features, but the older way is 100% universally supported):</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>* wglChoosePixelFormatARB. See values WGL_COLOR_BITS_ARB, WGL_RED/GREEN/BLUE_BITS_ARB, <del class="diffchange diffchange-inline">GL_AUX_BUFFERS_ARB</del>. See docs on http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt .</div></td><td class='diff-marker'>+</td><td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>* wglChoosePixelFormatARB. See values WGL_COLOR_BITS_ARB, WGL_RED/GREEN/BLUE_BITS_ARB, <ins class="diffchange diffchange-inline">WGL_AUX_BUFFERS_ARB</ins>. See docs on http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt .</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* The older ChoosePixelFormat. See fields cColorBits, cAuxBuffers in PIXELFORMATDESCRIPTOR. There are also cRed/Green/BlueBits, but they are documented as unused. Docs on http://msdn.microsoft.com/en-us/library/dd318284%28v=vs.85%29.aspx .</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div>* The older ChoosePixelFormat. See fields cColorBits, cAuxBuffers in PIXELFORMATDESCRIPTOR. There are also cRed/Green/BlueBits, but they are documented as unused. Docs on http://msdn.microsoft.com/en-us/library/dd318284%28v=vs.85%29.aspx .</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"></td></tr>
</table>Michalishttps://wiki.freepascal.org/index.php?title=Extending_TOpenGLControl&diff=59298&oldid=prevMichalis: Information how to extend TOpenGLControl, to add properties like ColorBits and AuxBuffers2012-06-03T17:04:37Z<p>Information how to extend TOpenGLControl, to add properties like ColorBits and AuxBuffers</p>
<p><b>New page</b></p><div>Some information that may a useful starting point for someone willing to create a patch to add ColorBits and AuxBuffers and other similar properties to TOpenGLControl:<br />
<br />
1. For GLX (GTK), there are two ways to choose context attributes (both have to be supported for now, to support older GLX versions, and to allow multi-sampling on modern GLX versions):<br />
<br />
* glXChooseFBConfig. Docs on http://www.opengl.org/sdk/docs/man/xhtml/glXChooseFBConfig.xml .<br />
* glXChooseVisual. Docs on http://www.glprogramming.com/blue/ch07.html .<br />
<br />
They are both handled by common CreateOpenGLContextAttrList inside glgtkglxcontext.pas, they both support values GLX_RED/GREEN/BLUE_SIZE and GLX_AUX_BUFFERS.<br />
<br />
Current implementation sets minimum red/green/blue bits to 1.<br />
<br />
2. For WGL (WinAPI), also two ways of choosing context attributes are available, for similar reasons (the modern way has more features, but the older way is 100% universally supported):<br />
<br />
* wglChoosePixelFormatARB. See values WGL_COLOR_BITS_ARB, WGL_RED/GREEN/BLUE_BITS_ARB, GL_AUX_BUFFERS_ARB. See docs on http://www.opengl.org/registry/specs/ARB/wgl_pixel_format.txt .<br />
* The older ChoosePixelFormat. See fields cColorBits, cAuxBuffers in PIXELFORMATDESCRIPTOR. There are also cRed/Green/BlueBits, but they are documented as unused. Docs on http://msdn.microsoft.com/en-us/library/dd318284%28v=vs.85%29.aspx .<br />
<br />
Current implementation sets color bits = 24.<br />
<br />
Note that you cannot request complete colorbits for GLX (only separate r/g/b bits), and you cannot request separate r/g/b bits for WinAPI with ChoosePixelFormat. Probably we should make separate ColorBitsRed, ColorBitsGreen, ColorBitsBlue properties (as these are more flexible), and for ChoosePixelFormat just pass PIXELFORMATDESCRIPTOR.cColorBits := ColorBitsRed + ColorBitsGreen + ColorBitsBlue.<br />
<br />
I hope this information helps anyone willing to create a patch :) The job is fairly easy, you can grep e.g. for AlphaBits inside lazarus/trunk/components/opengl/ to see where you need to insert your code. You basically pass down the information to appropriate WGL/GLX routines.</div>Michalis