From d0bb5159f986f7e05c07360c88192f1a29f89122 Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sun, 13 Aug 2023 05:14:06 +0200 Subject: GraphUIDemoArgs: Issue GLProfile.initSingleton() once in static init block, ensuring JOGL is completely initialized Noteable: On MacOS 13.1 (aarch64) UISceneDemo20 won't show the window if NEWT is initialized before JOGL core via GLProfile.initSingleton(). --- src/demos/com/jogamp/opengl/demos/graph/ui/util/GraphUIDemoArgs.java | 4 ++++ src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/demos/com/jogamp/opengl/demos/graph/ui/util/GraphUIDemoArgs.java b/src/demos/com/jogamp/opengl/demos/graph/ui/util/GraphUIDemoArgs.java index 93fa2da37..fe716419a 100644 --- a/src/demos/com/jogamp/opengl/demos/graph/ui/util/GraphUIDemoArgs.java +++ b/src/demos/com/jogamp/opengl/demos/graph/ui/util/GraphUIDemoArgs.java @@ -41,6 +41,10 @@ public class GraphUIDemoArgs { public int sceneMSAASamples = 0; public float debugBoxThickness = 0f; + static { + GLProfile.initSingleton(); // ensure JOGL is completely initialized + } + public GraphUIDemoArgs(final int width, final int height, final int renderModes) { this.surface_width = width; this.surface_height = height; diff --git a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java index 257c71ee7..31dbee3af 100644 --- a/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java +++ b/src/jogl/classes/com/jogamp/opengl/swt/GLCanvas.java @@ -343,7 +343,7 @@ public class GLCanvas extends Canvas implements GLAutoDrawable, GLSharedContextS /* NO_BACKGROUND required to avoid clearing bg in native SWT widget (we do this in the GL display) */ super(parent, style | SWT.NO_BACKGROUND); - GLProfile.initSingleton(); // ensure JOGL is completly initialized + GLProfile.initSingleton(); // ensure JOGL is completely initialized SWTAccessor.setRealized(this, true); -- cgit v1.2.3