From 64b40bd4359cad46ebf62751ea342d80205bd98b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Thu, 18 May 2023 06:22:41 +0200 Subject: Sound3D/Context: Use same base ctor to initialize `hasALC_thread_local_context`, benefitting from thread-local-context --- src/java/com/jogamp/openal/sound3d/Context.java | 3 +-- src/test/com/jogamp/openal/test/manual/Sound3DTest.java | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/java/com/jogamp/openal/sound3d/Context.java b/src/java/com/jogamp/openal/sound3d/Context.java index 6cd19d6..28e033e 100644 --- a/src/java/com/jogamp/openal/sound3d/Context.java +++ b/src/java/com/jogamp/openal/sound3d/Context.java @@ -75,8 +75,7 @@ public class Context { * @param device The device the Context is being created for. */ public Context(final Device device) { - this.device = device; - this.alCtx = AudioSystem3D.alc.alcCreateContext(device.getALDevice(), null); + this(AudioSystem3D.alc.alcCreateContext(device.getALDevice(), null), device); } /** diff --git a/src/test/com/jogamp/openal/test/manual/Sound3DTest.java b/src/test/com/jogamp/openal/test/manual/Sound3DTest.java index 1a792b6..62a758a 100644 --- a/src/test/com/jogamp/openal/test/manual/Sound3DTest.java +++ b/src/test/com/jogamp/openal/test/manual/Sound3DTest.java @@ -64,7 +64,7 @@ public class Sound3DTest { // create the initial context - this can be collapsed into the init. final Device device = AudioSystem3D.openDevice(null); - final Context context = AudioSystem3D.createContext(device); + final Context context = new Context(device); if( !context.makeCurrent() ) { System.err.println("Context.makeCurrent() failed"); return; -- cgit v1.2.3