<div style="font-family: Arial; font-size: 14px;"><span style="font-family: system-ui, sans-serif; font-size: 0.875rem;"><br></span></div><div style="font-family: Arial; font-size: 14px;"><span style="font-family: system-ui, sans-serif; font-size: 0.875rem;">Le vendredi 6 janvier 2023 à 12:15, Maurizio Cimadamore a écrit :</span></div><div class="protonmail_quote">
<blockquote class="protonmail_quote" type="cite">
<p>Really good progress!</p><div>
Do you think that that the same set of bindings will not work across
OS? Why?</div><blockquote type="cite"><div style="font-family: Arial; font-size: 14px;">
</div></blockquote></blockquote><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">For the reasons you previously mentioned :) But assuming the type differences are hidden by GL API, maybe there will be no difference. When back on Linux and Windows, I'll check if I can use bindings generated with my macOS and will tell you.</div><div style="font-family: Arial; font-size: 14px;"><br></div><div style="font-family: Arial; font-size: 14px;">In addition to a potential variation between OS, there are variation between the OpenGL versions supported on each computer. The computer generating the bindings may support OpenGL 4.6 and generate bindings for this version, which won't be compatible with another older macOS supporting say OpenGL 3. </div><div style="font-family: Arial; font-size: 14px;"><br></div><blockquote class="protonmail_quote" type="cite">
<p>Other options, if you are into classfile manipulation are:</p>
<p>* ASM (perhaps the more popular, what the JDK itself uses):
<a href="https://asm.ow2.io/" class="moz-txt-link-freetext" rel="noreferrer nofollow noopener" target="_blank">https://asm.ow2.io/</a><br></p><p>
* the brand new JDK classfile API:
<a href="https://mail.openjdk.org/pipermail/classfile-api-dev/2022-June/000000.html" class="moz-txt-link-freetext" rel="noreferrer nofollow noopener" target="_blank">https://mail.openjdk.org/pipermail/classfile-api-dev/2022-June/000000.html</a><br></p></blockquote><p style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></p><p style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Thank you! The classfile API looks interesting but still at the draft status, so I'll rather go for ASM.</p><p style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></p><blockquote class="protonmail_quote" type="cite"><p>
</p>
<blockquote type="cite">
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">To answer the
"well-behave" nature of OpenGL</div>
<div style="font-family: Arial; font-size: 14px;">
<ul>
<li><span>Yes, there are types to hide differences per
platform. OpenGL is an API so one can expect to find the
same headers everywhere.</span></li>
<li><span>BUT OpenGL has dynamic loading capabilities to allow
getting features on computers that have hardware (GPU)
supporting some kind of rendering, and others not able to
do the same, still running on the same OS but not the same
GPU. That is a very interesting case for Panama. In that
case I'll have to rely on OpenGL API methods that load
functions only if they are supported on the host computer.</span></li>
</ul>
</div>
</blockquote>
<p>I think you refer to GL extensions - aren't there like opaque
function pointers whose existence you can query dynamically? </p></blockquote><p style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Yes!</p><blockquote class="protonmail_quote" type="cite"><p><span style="font-size: 0.875rem;">That said, the fact that there are extensions, doesn't mean that
the jextract bindings would not be portable across OSs ? But more
that you need to write some kind of support to discover and invoke
the extension functions? (wild guess here)</span></p></blockquote><p style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></p><p style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Exactly!</p><p style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);"><br></p><blockquote class="protonmail_quote" type="cite"><p>
</p>
<blockquote type="cite">
<div style="font-family: Arial; font-size: 14px;"><br>
</div>
<div style="font-family: Arial; font-size: 14px;">A bit more about
OpenGL</div>
<div style="font-family: Arial; font-size: 14px;">
<ul>
<li>Sometime I have to ask the OS to do things such as
executing java runnable on the main macOS thread. For now
this requires I keep using manually generated binding from
JOGL, allowing to use Objective C code. <a title="I don't think JExtract can do this" href="https://urldefense.com/v3/__https://github.com/manuelbl/JavaDoesUSB/issues/5__;!!ACWV5N9M2RV99hQ!Kml55Ybj-rpsn3N8SEjStiscqW8Ma0NJklvvm_C6lYscfvg2Y8qEDk_fJLbitlLqV4ZvtoW5kfz9q_NBqkWJJWQNXyD0UYfPT9ePYA$" rel="noreferrer nofollow noopener" target="_blank">I don't think JExtract can do this</a>.</li>
</ul>
</div>
</blockquote>
<p>Does passing this option " -XstartOnFirstThread" to the JVM
works? IIRC, it was added for things like these.</p></blockquote><p style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Yes it does. However JOGL & LWJGL took a different approach. LWJGL required it, while JOGL does the necessary things so that it is not needed to start the JVM on the first thread to have OpenGL properly working. I'd like to follow the JOGL approach which makes the usage more straightforward (but my dev more complex :)</p><p style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Thank you for your time and attention Maurizio!</p><p style="font-family: Arial; font-size: 14px; color: rgb(0, 0, 0);">Martin</p>
</div>