JEP-412 & OpenGL
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Fri Sep 17 16:26:10 UTC 2021
Hi Martin,
We have no plans to drop support for JNI. JEP 412 offers a replacement
which allows libraries to express bindings purely in Java code. In most
cases, this is desirable, but I understand that frameworks written prior
that JEP might have little to no appetite to rewrite everyting to use
MethodHandle/VarHandle and/or jextract.
As you noted, OpenGL works well with the new foreign APIs, and we have
written various samples using OpenGL bindings generated by jextract.
That said, it is beyond the goal of JEP 412 (and its succesors) to
provide an uniform OpenGL API _within the JDK_ - but I think the foreign
APIs and the tools (jextract) are now reaching a level of maturity which
would allow for such experiments to occur outside the JDK, and we'd be
pleased to hear some feedback in the panama-dev mailing list!
Hope this answers your question
Maurizio
On 17/09/2021 12:54, Martin Pernollet wrote:
> Hi,
>
> I actively maintain Jzy3D [1], a framework for drawing 3D charts in Java. It uses JOGL which access native OpenGL with the help of GlueGen, a tool to generate JNI bindings. Jzy3D has an additional OpenGL pure Java CPU renderer [2] to circumvent compatibility limitations of JOGL, mainly for MacOS.
>
> Will JEP-412 close the doors to bindings relying on JNI? In other word will JOGL be able to continue working with GlueGen and JNI?
>
> Are there known plans in OpenJDK for enabling OpenGL (+Metal?) consistently across OS and hardwares via a unified API? II have seen an OpenGL example based on JEP-412 here [3]. I would be interested to assist on that topic and may help making Jzy3D compatible to such API. Jzy3D indeed offers a IPainter interface [4] that allows pluging multiple implementations of OpenGL for Java, hence helping to compare JOGL, EmulGL or any other OpenGL java API.
>
> Thanks in advance,
>
> Martin
>
> [1] http://jzy3d.org/
>
> [2] https://github.com/jzy3d/jzy3d-api/tree/69a14166096a46bfb6e74cd3ab02e11d41c09024/jzy3d-emul-gl
> [3] https://github.com/sundararajana/panama-jextract-samples/tree/master/opengl
> [4] https://github.com/jzy3d/jzy3d-api/blob/69a14166096a46bfb6e74cd3ab02e11d41c09024/jzy3d-core/src/main/java/org/jzy3d/painters/IPainter.java
More information about the panama-dev
mailing list