JVM hang with Swing and macOS
Michael Hall
mik3hall at gmail.com
Tue Mar 21 20:12:35 UTC 2023
> On Mar 21, 2023, at 12:39 PM, Martin Pernollet <martin.pernollet at protonmail.com> wrote:
>
> Hi,
>
> Thank you Sergey, Michael and Alan.
>
> It seams the OGLUtilities does not exists anymore <https://github.com/openjdk/jdk/tree/master/src/java.desktop/macosx/classes/sun/java2d/opengl>. Do you know if there is a replacer?
>
> The current version of PanamaGL <https://gitlab.com/jzy3d/panama-gl> is quite simple : it opens an opengl context, either with GLUT, either with the platform specific lib to do it (WGL on windows, GLX on Linux, CGL on macOS) and then performs offscreen rendering in a frame buffer. The result is then copied to a BufferedImage that is then simply rendered by a Swing canvas <https://gitlab.com/jzy3d/panama-gl/-/blob/main/panama-gl-ui-swing/src/main/java/panamagl/canvas/GLCanvasSwing.java#L170>. I know rendering through JAWT would be more efficient but this first step was easy to achieve in one shot for all platforms (and it works pretty well :).
>
> Cheers,
>
> Martin
>
Martin,
Start another java process -XstartOnMainThread that does the OpenGL part from a Swing application? One hang up there though might be that I don’t think java applications that include the java native commands are allowed in the Mac App Store. Another bug due to each command has it’s own unique CFBundleIdentifier but that identifier is always the same and Apple doesn’t allow duplicates in the App Store.
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/client-libs-dev/attachments/20230321/bbfd66c2/attachment.htm>
More information about the client-libs-dev
mailing list