diff options
author | Sven Gothel <[email protected]> | 2023-05-18 06:22:41 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-05-18 06:22:41 +0200 |
commit | 64b40bd4359cad46ebf62751ea342d80205bd98b (patch) | |
tree | 56f9e03925559f5cbe0aed607f5673bdfa1a6eeb | |
parent | 7f73d50c90d05cf7388f23977ca956a4933019ad (diff) |
Sound3D/Context: Use same base ctor to initialize `hasALC_thread_local_context`, benefitting from thread-local-context
-rw-r--r-- | src/java/com/jogamp/openal/sound3d/Context.java | 3 | ||||
-rw-r--r-- | 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; |