From dc4fd14437222f60660a31597fc0274b331775cc Mon Sep 17 00:00:00 2001 From: Ioannis Tsakpinis Date: Tue, 14 Feb 2023 18:11:27 +0200 Subject: [PATCH] feat(openal) update to 1.23.0 & add new extensions - ALC_SOFT_loopback_bformat - AL_SOFT_effect_target - AL_SOFT_events Close #854 --- doc/notes/3.3.2.md | 5 +- .../src/generated/c/org_lwjgl_system_JNI.c | 14 +++ .../generated/java/org/lwjgl/system/JNI.java | 3 + .../org/lwjgl/openal/ALCCapabilities.java | 3 + .../java/org/lwjgl/openal/ALCapabilities.java | 61 +++++++--- .../org/lwjgl/openal/SOFTEffectTarget.java | 32 +++++ .../java/org/lwjgl/openal/SOFTEventProc.java | 78 ++++++++++++ .../java/org/lwjgl/openal/SOFTEventProcI.java | 55 +++++++++ .../java/org/lwjgl/openal/SOFTEvents.java | 112 ++++++++++++++++++ .../org/lwjgl/openal/SOFTLoopbackBformat.java | 43 +++++++ .../src/templates/kotlin/openal/ALTypes.kt | 18 +++ .../templates/ALC_SOFT_loopback_bformat.kt | 55 +++++++++ .../openal/templates/AL_SOFT_effect_target.kt | 35 ++++++ .../kotlin/openal/templates/AL_SOFT_events.kt | 69 +++++++++++ 14 files changed, 566 insertions(+), 17 deletions(-) create mode 100644 modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEffectTarget.java create mode 100644 modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEventProc.java create mode 100644 modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEventProcI.java create mode 100644 modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEvents.java create mode 100644 modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTLoopbackBformat.java create mode 100644 modules/lwjgl/openal/src/templates/kotlin/openal/templates/ALC_SOFT_loopback_bformat.kt create mode 100644 modules/lwjgl/openal/src/templates/kotlin/openal/templates/AL_SOFT_effect_target.kt create mode 100644 modules/lwjgl/openal/src/templates/kotlin/openal/templates/AL_SOFT_events.kt diff --git a/doc/notes/3.3.2.md b/doc/notes/3.3.2.md index 62610a022b..15296c1ade 100644 --- a/doc/notes/3.3.2.md +++ b/doc/notes/3.3.2.md @@ -30,10 +30,13 @@ This build includes the following changes: - NativeFileDialog: Switched to [Native File Dialog Extended](https://github.com/btzy/nativefiledialog-extended) (#823) * This is a fork of the original library with new features and breaking API changes. - Nuklear: Updated to 4.10.4 (up from 4.9.6) -- OpenAL Soft: Updated to 1.22.2 (up from 1.21.1) +- OpenAL Soft: Updated to 1.23.0 (up from 1.21.1) + * Added `ALC_SOFT_loopback_bformat` extension. * Added `ALC_SOFT_output_mode` extension. * Added `ALC_SOFT_reopen_device` extension. * Added `AL_SOFT_callback_buffer` extension. + * Added `AL_SOFT_effect_target` extension. + * Added `AL_SOFT_events` extension. (#854) * Added `AL_SOFT_UHJ` extension. - OpenGL(ES): Added latest extensions. * `GL_EXT_fragment_shading_rate` diff --git a/modules/lwjgl/core/src/generated/c/org_lwjgl_system_JNI.c b/modules/lwjgl/core/src/generated/c/org_lwjgl_system_JNI.c index 39fba673ae..12db599677 100644 --- a/modules/lwjgl/core/src/generated/c/org_lwjgl_system_JNI.c +++ b/modules/lwjgl/core/src/generated/c/org_lwjgl_system_JNI.c @@ -1287,6 +1287,10 @@ JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IIJJ(JNIEnv *__env, j UNUSED_PARAMS(__env, clazz) ((void (*) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)param2); } +JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__IJZJ(JNIEnv *__env, jclass clazz, jint param0, jlong param1, jboolean param2, jlong __functionAddress) { + UNUSED_PARAMS(__env, clazz) + ((void (*) (jint, uintptr_t, jboolean))(uintptr_t)__functionAddress)(param0, (uintptr_t)param1, param2); +} JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__JDDJ(JNIEnv *__env, jclass clazz, jlong param0, jdouble param1, jdouble param2, jlong __functionAddress) { UNUSED_PARAMS(__env, clazz) ((void (*) (uintptr_t, jdouble, jdouble))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, param2); @@ -1543,6 +1547,10 @@ JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__SSBJJJ(JNIEnv *__env UNUSED_PARAMS(__env, clazz) ((void (*) (jshort, jshort, jbyte, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, (uintptr_t)param3, (uintptr_t)param4); } +JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__IIIIJJJ(JNIEnv *__env, jclass clazz, jint param0, jint param1, jint param2, jint param3, jlong param4, jlong param5, jlong __functionAddress) { + UNUSED_PARAMS(__env, clazz) + ((void (*) (jint, jint, jint, jint, uintptr_t, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, param2, param3, (uintptr_t)param4, (uintptr_t)param5); +} JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePPV__JBJIISJ(JNIEnv *__env, jclass clazz, jlong param0, jbyte param1, jlong param2, jint param3, jint param4, jshort param5, jlong __functionAddress) { UNUSED_PARAMS(__env, clazz) ((void (*) (uintptr_t, jbyte, uintptr_t, jint, jint, jshort))(uintptr_t)__functionAddress)((uintptr_t)param0, param1, (uintptr_t)param2, param3, param4, param5); @@ -4666,6 +4674,12 @@ JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__II_3JJ(JNIEnv *__env, ((void (*) (jint, jint, uintptr_t))(uintptr_t)__functionAddress)(param0, param1, (uintptr_t)paramArray2); if (param2 != NULL) { (*__env)->ReleaseLongArrayElements(__env, param2, paramArray2, 0); } } +JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__I_3IZJ(JNIEnv *__env, jclass clazz, jint param0, jintArray param1, jboolean param2, jlong __functionAddress) { + UNUSED_PARAMS(__env, clazz) + void *paramArray1 = param1 == NULL ? NULL : (*__env)->GetIntArrayElements(__env, param1, NULL); + ((void (*) (jint, uintptr_t, jboolean))(uintptr_t)__functionAddress)(param0, (uintptr_t)paramArray1, param2); + if (param1 != NULL) { (*__env)->ReleaseIntArrayElements(__env, param1, paramArray1, 0); } +} JNIEXPORT void JNICALL Java_org_lwjgl_system_JNI_invokePV__SS_3SJ(JNIEnv *__env, jclass clazz, jshort param0, jshort param1, jshortArray param2, jlong __functionAddress) { UNUSED_PARAMS(__env, clazz) void *paramArray2 = param2 == NULL ? NULL : (*__env)->GetShortArrayElements(__env, param2, NULL); diff --git a/modules/lwjgl/core/src/generated/java/org/lwjgl/system/JNI.java b/modules/lwjgl/core/src/generated/java/org/lwjgl/system/JNI.java index b67b753422..7d33651022 100644 --- a/modules/lwjgl/core/src/generated/java/org/lwjgl/system/JNI.java +++ b/modules/lwjgl/core/src/generated/java/org/lwjgl/system/JNI.java @@ -357,6 +357,7 @@ private JNI() {} public static native void invokePV(short param0, long param1, long __functionAddress); public static native void invokeJV(int param0, int param1, long param2, long __functionAddress); public static native void invokePV(int param0, int param1, long param2, long __functionAddress); + public static native void invokePV(int param0, long param1, boolean param2, long __functionAddress); public static native void invokePV(long param0, double param1, double param2, long __functionAddress); public static native void invokePV(long param0, float param1, float param2, long __functionAddress); public static native void invokePV(long param0, int param1, double param2, long __functionAddress); @@ -421,6 +422,7 @@ private JNI() {} public static native void invokePPV(long param0, int param1, int param2, int param3, long param4, long __functionAddress); public static native void invokePPV(long param0, long param1, int param2, int param3, int param4, long __functionAddress); public static native void invokePPV(short param0, short param1, byte param2, long param3, long param4, long __functionAddress); + public static native void invokePPV(int param0, int param1, int param2, int param3, long param4, long param5, long __functionAddress); public static native void invokePPV(long param0, byte param1, long param2, int param3, int param4, short param5, long __functionAddress); public static native void invokePPV(long param0, int param1, int param2, int param3, int param4, long param5, long __functionAddress); public static native void invokePPV(long param0, long param1, float param2, float param3, float param4, float param5, long __functionAddress); @@ -1175,6 +1177,7 @@ private JNI() {} public static native void invokePV(int param0, int param1, @Nullable float[] param2, long __functionAddress); public static native void invokePV(int param0, int param1, @Nullable int[] param2, long __functionAddress); public static native void invokePV(int param0, int param1, @Nullable long[] param2, long __functionAddress); + public static native void invokePV(int param0, @Nullable int[] param1, boolean param2, long __functionAddress); public static native void invokePV(short param0, short param1, @Nullable short[] param2, long __functionAddress); public static native void invokePV(short param0, @Nullable double[] param1, short param2, long __functionAddress); public static native void invokePV(short param0, @Nullable float[] param1, short param2, long __functionAddress); diff --git a/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/ALCCapabilities.java b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/ALCCapabilities.java index d8f6cad1b8..37cc53f573 100644 --- a/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/ALCCapabilities.java +++ b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/ALCCapabilities.java @@ -74,6 +74,8 @@ public final class ALCCapabilities { public final boolean OpenALC10; /** When true, {@link ALC11} is supported. */ public final boolean OpenALC11; + /** When true, {@link SOFTLoopbackBformat} is supported. */ + public final boolean OpenALC_SOFT_loopback_bformat; /** When true, {@link EnumerateAllExt} is supported. */ public final boolean ALC_ENUMERATE_ALL_EXT; /** @@ -124,6 +126,7 @@ public final class ALCCapabilities { OpenALC10 = check_ALC10(provider, device, caps, ext); OpenALC11 = check_ALC11(provider, device, caps, ext); + OpenALC_SOFT_loopback_bformat = ext.contains("OpenALC_SOFT_loopback_bformat"); ALC_ENUMERATE_ALL_EXT = ext.contains("ALC_ENUMERATE_ALL_EXT"); ALC_ENUMERATION_EXT = ext.contains("ALC_ENUMERATION_EXT"); ALC_EXT_CAPTURE = check_EXT_CAPTURE(provider, device, caps, ext); diff --git a/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/ALCapabilities.java b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/ALCapabilities.java index 64cf23a7b1..d7204e68fb 100644 --- a/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/ALCapabilities.java +++ b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/ALCapabilities.java @@ -154,6 +154,13 @@ public final class ALCapabilities { alDeferUpdatesSOFT, alProcessUpdatesSOFT; + // SOFT_events + public final long + alEventControlSOFT, + alEventCallbackSOFT, + alGetPointerSOFT, + alGetPointervSOFT; + // SOFT_source_latency public final long alSourcedSOFT, @@ -235,6 +242,10 @@ public final class ALCapabilities { public final boolean AL_SOFT_direct_channels; /** When true, {@link SOFTDirectChannelsRemix} is supported. */ public final boolean AL_SOFT_direct_channels_remix; + /** When true, {@link SOFTEffectTarget} is supported. */ + public final boolean AL_SOFT_effect_target; + /** When true, {@link SOFTEvents} is supported. */ + public final boolean AL_SOFT_events; /** When true, {@link SOFTGainClampEx} is supported. */ public final boolean AL_SOFT_gain_clamp_ex; /** When true, {@link SOFTLoopPoints} is supported. */ @@ -256,7 +267,7 @@ public final class ALCapabilities { final PointerBuffer addresses; ALCapabilities(FunctionProvider provider, Set ext, IntFunction bufferFactory) { - PointerBuffer caps = bufferFactory.apply(127); + PointerBuffer caps = bufferFactory.apply(131); OpenAL10 = check_AL10(provider, caps, ext); OpenAL11 = check_AL11(provider, caps, ext); @@ -289,6 +300,8 @@ public final class ALCapabilities { AL_SOFT_deferred_updates = check_SOFT_deferred_updates(provider, caps, ext); AL_SOFT_direct_channels = ext.contains("AL_SOFT_direct_channels"); AL_SOFT_direct_channels_remix = ext.contains("AL_SOFT_direct_channels_remix"); + AL_SOFT_effect_target = ext.contains("AL_SOFT_effect_target"); + AL_SOFT_events = check_SOFT_events(provider, caps, ext); AL_SOFT_gain_clamp_ex = ext.contains("AL_SOFT_gain_clamp_ex"); AL_SOFT_loop_points = ext.contains("AL_SOFT_loop_points"); AL_SOFT_MSADPCM = ext.contains("AL_SOFT_MSADPCM"); @@ -412,19 +425,23 @@ public final class ALCapabilities { alGetBufferPtrvSOFT = caps.get(111); alDeferUpdatesSOFT = caps.get(112); alProcessUpdatesSOFT = caps.get(113); - alSourcedSOFT = caps.get(114); - alSource3dSOFT = caps.get(115); - alSourcedvSOFT = caps.get(116); - alGetSourcedSOFT = caps.get(117); - alGetSource3dSOFT = caps.get(118); - alGetSourcedvSOFT = caps.get(119); - alSourcei64SOFT = caps.get(120); - alSource3i64SOFT = caps.get(121); - alSourcei64vSOFT = caps.get(122); - alGetSourcei64SOFT = caps.get(123); - alGetSource3i64SOFT = caps.get(124); - alGetSourcei64vSOFT = caps.get(125); - alGetStringiSOFT = caps.get(126); + alEventControlSOFT = caps.get(114); + alEventCallbackSOFT = caps.get(115); + alGetPointerSOFT = caps.get(116); + alGetPointervSOFT = caps.get(117); + alSourcedSOFT = caps.get(118); + alSource3dSOFT = caps.get(119); + alSourcedvSOFT = caps.get(120); + alGetSourcedSOFT = caps.get(121); + alGetSource3dSOFT = caps.get(122); + alGetSourcedvSOFT = caps.get(123); + alSourcei64SOFT = caps.get(124); + alSource3i64SOFT = caps.get(125); + alSourcei64vSOFT = caps.get(126); + alGetSourcei64SOFT = caps.get(127); + alGetSource3i64SOFT = caps.get(128); + alGetSourcei64vSOFT = caps.get(129); + alGetStringiSOFT = caps.get(130); addresses = ThreadLocalUtil.setupAddressBuffer(caps); } @@ -542,13 +559,25 @@ private static boolean check_SOFT_deferred_updates(FunctionProvider provider, Po ) || reportMissing("AL", "AL_SOFT_deferred_updates"); } + private static boolean check_SOFT_events(FunctionProvider provider, PointerBuffer caps, Set ext) { + if (!ext.contains("AL_SOFT_events")) { + return false; + } + + return checkFunctions(provider, caps, new int[] { + 114, 115, 116, 117 + }, + "alEventControlSOFT", "alEventCallbackSOFT", "alGetPointerSOFT", "alGetPointervSOFT" + ) || reportMissing("AL", "AL_SOFT_events"); + } + private static boolean check_SOFT_source_latency(FunctionProvider provider, PointerBuffer caps, Set ext) { if (!ext.contains("AL_SOFT_source_latency")) { return false; } return checkFunctions(provider, caps, new int[] { - 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125 + 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129 }, "alSourcedSOFT", "alSource3dSOFT", "alSourcedvSOFT", "alGetSourcedSOFT", "alGetSource3dSOFT", "alGetSourcedvSOFT", "alSourcei64SOFT", "alSource3i64SOFT", "alSourcei64vSOFT", "alGetSourcei64SOFT", "alGetSource3i64SOFT", "alGetSourcei64vSOFT" @@ -561,7 +590,7 @@ private static boolean check_SOFT_source_resampler(FunctionProvider provider, Po } return checkFunctions(provider, caps, new int[] { - 126 + 130 }, "alGetStringiSOFT" ) || reportMissing("AL", "AL_SOFT_source_resampler"); diff --git a/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEffectTarget.java b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEffectTarget.java new file mode 100644 index 0000000000..c504fbe43a --- /dev/null +++ b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEffectTarget.java @@ -0,0 +1,32 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the SOFT_effect_target extension. + * + *

This extension provides a method to reroute the output of an auxiliary effect slot to the input of another auxiliary effect slot. By default, an effect + * slot's output is added to the main output along side other effect slots and each source's direct path. This makes it impossible to, for example, apply + * an equalizer effect to the output of a chorus effect since the chorus and equalizer effects are processed separately.

+ * + *

Retargeting an effect slot's output to another effect slot allows chaining multiple effects to create results that aren't possible with standard EFX.

+ */ +public final class SOFTEffectTarget { + + /** + * Specifies the target effect slot for this effect slot's output. + * + *

The rendered output of this effect slot is added to the input of the specified target effect slot, which will be subsequently processed by the target + * effect slot's effect. Specifying {@link EXTEfx#AL_EFFECTSLOT_NULL EFFECTSLOT_NULL} for the ID reverts the effect slot's output back to the main output.

+ * + *

An effect slot that is the target of another effect slot cannot be deleted or an {@link AL10#AL_INVALID_OPERATION INVALID_OPERATION} error will be generated. An effect slot cannot be + * set as a target if it would feed its own input through 0 or more other effect slots, or an {@code AL_INVALID_OPERATION} error will be generated.

+ */ + public static final int AL_EFFECTSLOT_TARGET_SOFT = 0x199C; + + private SOFTEffectTarget() {} + +} \ No newline at end of file diff --git a/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEventProc.java b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEventProc.java new file mode 100644 index 0000000000..39f2a6a552 --- /dev/null +++ b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEventProc.java @@ -0,0 +1,78 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     ALenum eventType,
+ *     ALuint object,
+ *     ALuint param,
+ *     ALsizei length,
+ *     ALchar const *message,
+ *     ALvoid *userParam
+ * )
+ */ +public abstract class SOFTEventProc extends Callback implements SOFTEventProcI { + + /** + * Creates a {@code SOFTEventProc} instance from the specified function pointer. + * + * @return the new {@code SOFTEventProc} + */ + public static SOFTEventProc create(long functionPointer) { + SOFTEventProcI instance = Callback.get(functionPointer); + return instance instanceof SOFTEventProc + ? (SOFTEventProc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static SOFTEventProc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code SOFTEventProc} instance that delegates to the specified {@code SOFTEventProcI} instance. */ + public static SOFTEventProc create(SOFTEventProcI instance) { + return instance instanceof SOFTEventProc + ? (SOFTEventProc)instance + : new Container(instance.address(), instance); + } + + protected SOFTEventProc() { + super(CIF); + } + + SOFTEventProc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends SOFTEventProc { + + private final SOFTEventProcI delegate; + + Container(long functionPointer, SOFTEventProcI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(int eventType, int object, int param, int length, long message, long userParam) { + delegate.invoke(eventType, object, param, length, message, userParam); + } + + } + +} \ No newline at end of file diff --git a/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEventProcI.java b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEventProcI.java new file mode 100644 index 0000000000..d7797385c1 --- /dev/null +++ b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEventProcI.java @@ -0,0 +1,55 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import org.lwjgl.system.*; +import org.lwjgl.system.libffi.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libffi.LibFFI.*; + +/** + *

Type

+ * + *

+ * void (*{@link #invoke}) (
+ *     ALenum eventType,
+ *     ALuint object,
+ *     ALuint param,
+ *     ALsizei length,
+ *     ALchar const *message,
+ *     ALvoid *userParam
+ * )
+ */ +@FunctionalInterface +@NativeType("ALEVENTPROCSOFT") +public interface SOFTEventProcI extends CallbackI { + + FFICIF CIF = apiCreateCIF( + FFI_DEFAULT_ABI, + ffi_type_void, + ffi_type_sint32, ffi_type_uint32, ffi_type_uint32, ffi_type_sint32, ffi_type_pointer, ffi_type_pointer + ); + + @Override + default FFICIF getCallInterface() { return CIF; } + + @Override + default void callback(long ret, long args) { + invoke( + memGetInt(memGetAddress(args)), + memGetInt(memGetAddress(args + POINTER_SIZE)), + memGetInt(memGetAddress(args + 2 * POINTER_SIZE)), + memGetInt(memGetAddress(args + 3 * POINTER_SIZE)), + memGetAddress(memGetAddress(args + 4 * POINTER_SIZE)), + memGetAddress(memGetAddress(args + 5 * POINTER_SIZE)) + ); + } + + void invoke(@NativeType("ALenum") int eventType, @NativeType("ALuint") int object, @NativeType("ALuint") int param, @NativeType("ALsizei") int length, @NativeType("ALchar const *") long message, @NativeType("ALvoid *") long userParam); + +} \ No newline at end of file diff --git a/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEvents.java b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEvents.java new file mode 100644 index 0000000000..597a224c80 --- /dev/null +++ b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTEvents.java @@ -0,0 +1,112 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the SOFT_events extension. + * + *

This extension provides a method for applications to receive notifications about audio events via an asynchronous callback. This can help alleviate the + * need for applications to continually poll the AL to check if an event happened, and instead allow them to respond when events happen. Such events can + * include a source changing state or a device becoming disconnected.

+ */ +public class SOFTEvents { + + /** Accepted as the {@code pname} parameter of {@link #alGetPointerSOFT GetPointerSOFT} and {@link #alGetPointervSOFT GetPointervSOFT}. */ + public static final int + AL_EVENT_CALLBACK_FUNCTION_SOFT = 0x19A2, + AL_EVENT_CALLBACK_USER_PARAM_SOFT = 0x19A3; + + /** + * Accepted as an element in the {@code types} parameter of {@link #alEventControlSOFT EventControlSOFT}, and provided as the {@code eventType} parameter of + * {@code ALEVENTPROCSOFT} callback functions. + */ + public static final int + AL_EVENT_TYPE_BUFFER_COMPLETED_SOFT = 0x19A4, + AL_EVENT_TYPE_SOURCE_STATE_CHANGED_SOFT = 0x19A5, + AL_EVENT_TYPE_DISCONNECTED_SOFT = 0x19A6; + + protected SOFTEvents() { + throw new UnsupportedOperationException(); + } + + // --- [ alEventControlSOFT ] --- + + public static void nalEventControlSOFT(int count, long types, boolean enable) { + long __functionAddress = AL.getICD().alEventControlSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePV(count, types, enable, __functionAddress); + } + + public static void alEventControlSOFT(@NativeType("ALenum const *") IntBuffer types, @NativeType("ALboolean") boolean enable) { + nalEventControlSOFT(types.remaining(), memAddress(types), enable); + } + + // --- [ alEventCallbackSOFT ] --- + + public static void nalEventCallbackSOFT(long callback, long userParam) { + long __functionAddress = AL.getICD().alEventCallbackSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePPV(callback, userParam, __functionAddress); + } + + public static void alEventCallbackSOFT(@NativeType("ALEVENTPROCSOFT") SOFTEventProcI callback, @Nullable @NativeType("ALvoid *") ByteBuffer userParam) { + nalEventCallbackSOFT(callback.address(), memAddressSafe(userParam)); + } + + // --- [ alGetPointerSOFT ] --- + + @NativeType("ALvoid *") + public static long alGetPointerSOFT(@NativeType("ALenum") int pname) { + long __functionAddress = AL.getICD().alGetPointerSOFT; + if (CHECKS) { + check(__functionAddress); + } + return invokeP(pname, __functionAddress); + } + + // --- [ alGetPointervSOFT ] --- + + public static void nalGetPointervSOFT(int pname, long values) { + long __functionAddress = AL.getICD().alGetPointervSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePV(pname, values, __functionAddress); + } + + public static void alGetPointervSOFT(@NativeType("ALenum") int pname, @NativeType("ALvoid **") PointerBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetPointervSOFT(pname, memAddress(values)); + } + + /** Array version of: {@link #alEventControlSOFT EventControlSOFT} */ + public static void alEventControlSOFT(@NativeType("ALenum const *") int[] types, @NativeType("ALboolean") boolean enable) { + long __functionAddress = AL.getICD().alEventControlSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePV(types.length, types, enable, __functionAddress); + } + +} \ No newline at end of file diff --git a/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTLoopbackBformat.java b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTLoopbackBformat.java new file mode 100644 index 0000000000..ef382368e6 --- /dev/null +++ b/modules/lwjgl/openal/src/generated/java/org/lwjgl/openal/SOFTLoopbackBformat.java @@ -0,0 +1,43 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the ALC_SOFT_loopback_bformat extension. + * + *

This extension allows a loopback device to render B-Format audio channels. The base loopback extension provides for discrete channel mixes, while + * sometimes a non-discrete soundfield mix may be desirable, for instance if recording a 3D video or passing the output to an external ambisonic decoder.

+ */ +public final class SOFTLoopbackBformat { + + /** + * Accepted as parameters for {@link SOFTLoopback#ALC_FORMAT_CHANNELS_SOFT FORMAT_CHANNELS_SOFT} in the {@code attrList} parameter of {@link ALC10#alcCreateContext CreateContext}, and by the {@code channels} parameter of + * {@link SOFTLoopback#alcIsRenderFormatSupportedSOFT IsRenderFormatSupportedSOFT}. + */ + public static final int ALC_BFORMAT3D_SOFT = 0x1507; + + /** Accepted as part of the {@code attrList} parameter of {@link ALC10#alcCreateContext CreateContext}. */ + public static final int + ALC_AMBISONIC_LAYOUT_SOFT = 0x1997, + ALC_AMBISONIC_SCALING_SOFT = 0x1998, + ALC_AMBISONIC_ORDER_SOFT = 0x1999; + + /** Accepted as parameters for {@link #ALC_AMBISONIC_LAYOUT_SOFT AMBISONIC_LAYOUT_SOFT} in the {@code attrList} parameter of {@link ALC10#alcCreateContext CreateContext}. */ + public static final int + ALC_FUMA_SOFT = 0x0, + ALC_ACN_SOFT = 0x1; + + /** Accepted as parameters for {@link #ALC_AMBISONIC_SCALING_SOFT AMBISONIC_SCALING_SOFT} in the {@code attrList} parameter of {@link ALC10#alcCreateContext CreateContext}. */ + public static final int + ALC_SN3D_SOFT = 0x1, + ALC_N3D_SOFT = 0x2; + + /** Accepted as the {@code paramName} parameter of {@link AL10#alGetIntegerv GetIntegerv}. */ + public static final int ALC_MAX_AMBISONIC_ORDER_SOFT = 0x199B; + + private SOFTLoopbackBformat() {} + +} \ No newline at end of file diff --git a/modules/lwjgl/openal/src/templates/kotlin/openal/ALTypes.kt b/modules/lwjgl/openal/src/templates/kotlin/openal/ALTypes.kt index 3773510605..088139ca01 100644 --- a/modules/lwjgl/openal/src/templates/kotlin/openal/ALTypes.kt +++ b/modules/lwjgl/openal/src/templates/kotlin/openal/ALTypes.kt @@ -56,4 +56,22 @@ val ALBUFFERCALLBACKTYPESOFT = Module.OPENAL.callback { """, nativeType = "ALBUFFERCALLBACKTYPESOFT" ) +} + +// AL_SOFT_events + +val ALEVENTPROCSOFT = Module.OPENAL.callback { + void( + "SOFTEventProc", + "", + + ALenum("eventType", ""), + ALuint("object", ""), + ALuint("param", ""), + AutoSize("message")..ALsizei("length", ""), + ALcharASCII.const.p("message", ""), + Unsafe..nullable..ALvoid.p("userParam", ""), + + nativeType = "ALEVENTPROCSOFT" + ) } \ No newline at end of file diff --git a/modules/lwjgl/openal/src/templates/kotlin/openal/templates/ALC_SOFT_loopback_bformat.kt b/modules/lwjgl/openal/src/templates/kotlin/openal/templates/ALC_SOFT_loopback_bformat.kt new file mode 100644 index 0000000000..44308e06bf --- /dev/null +++ b/modules/lwjgl/openal/src/templates/kotlin/openal/templates/ALC_SOFT_loopback_bformat.kt @@ -0,0 +1,55 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package openal.templates + +import org.lwjgl.generator.* +import openal.* + +val ALC_SOFT_loopback_bformat = "SOFTLoopbackBformat".nativeClassALC("ALC_SOFT_loopback_bformat") { + documentation = + """ + Native bindings to the $specLinkOpenALSoft extension. + + This extension allows a loopback device to render B-Format audio channels. The base loopback extension provides for discrete channel mixes, while + sometimes a non-discrete soundfield mix may be desirable, for instance if recording a 3D video or passing the output to an external ambisonic decoder. + """ + + IntConstant( + """ + Accepted as parameters for #FORMAT_CHANNELS_SOFT in the {@code attrList} parameter of #CreateContext(), and by the {@code channels} parameter of + #IsRenderFormatSupportedSOFT(). + """, + + "BFORMAT3D_SOFT"..0x1507 + ) + + IntConstant( + "Accepted as part of the {@code attrList} parameter of #CreateContext().", + + "AMBISONIC_LAYOUT_SOFT"..0x1997, + "AMBISONIC_SCALING_SOFT"..0x1998, + "AMBISONIC_ORDER_SOFT"..0x1999 + ) + + IntConstant( + "Accepted as parameters for #AMBISONIC_LAYOUT_SOFT in the {@code attrList} parameter of #CreateContext().", + + "FUMA_SOFT"..0x0000, + "ACN_SOFT"..0x0001 + ) + + IntConstant( + "Accepted as parameters for #AMBISONIC_SCALING_SOFT in the {@code attrList} parameter of #CreateContext().", + + "SN3D_SOFT"..0x0001, + "N3D_SOFT"..0x0002 + ) + + IntConstant( + "Accepted as the {@code paramName} parameter of #GetIntegerv().", + + "MAX_AMBISONIC_ORDER_SOFT"..0x199B + ) +} \ No newline at end of file diff --git a/modules/lwjgl/openal/src/templates/kotlin/openal/templates/AL_SOFT_effect_target.kt b/modules/lwjgl/openal/src/templates/kotlin/openal/templates/AL_SOFT_effect_target.kt new file mode 100644 index 0000000000..69050ec9e9 --- /dev/null +++ b/modules/lwjgl/openal/src/templates/kotlin/openal/templates/AL_SOFT_effect_target.kt @@ -0,0 +1,35 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package openal.templates + +import org.lwjgl.generator.* +import openal.* + +val AL_SOFT_effect_target = "SOFTEffectTarget".nativeClassAL("SOFT_effect_target") { + documentation = + """ + Native bindings to the $specLinkOpenALSoft extension. + + This extension provides a method to reroute the output of an auxiliary effect slot to the input of another auxiliary effect slot. By default, an effect + slot's output is added to the main output along side other effect slots and each source's direct path. This makes it impossible to, for example, apply + an equalizer effect to the output of a chorus effect since the chorus and equalizer effects are processed separately. + + Retargeting an effect slot's output to another effect slot allows chaining multiple effects to create results that aren't possible with standard EFX. + """ + + IntConstant( + """ + Specifies the target effect slot for this effect slot's output. + + The rendered output of this effect slot is added to the input of the specified target effect slot, which will be subsequently processed by the target + effect slot's effect. Specifying #EFFECTSLOT_NULL for the ID reverts the effect slot's output back to the main output. + + An effect slot that is the target of another effect slot cannot be deleted or an #INVALID_OPERATION error will be generated. An effect slot cannot be + set as a target if it would feed its own input through 0 or more other effect slots, or an {@code AL_INVALID_OPERATION} error will be generated. + """, + + "EFFECTSLOT_TARGET_SOFT"..0x199C + ) +} \ No newline at end of file diff --git a/modules/lwjgl/openal/src/templates/kotlin/openal/templates/AL_SOFT_events.kt b/modules/lwjgl/openal/src/templates/kotlin/openal/templates/AL_SOFT_events.kt new file mode 100644 index 0000000000..4f141475d4 --- /dev/null +++ b/modules/lwjgl/openal/src/templates/kotlin/openal/templates/AL_SOFT_events.kt @@ -0,0 +1,69 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package openal.templates + +import org.lwjgl.generator.* +import openal.* + +val AL_SOFT_events = "SOFTEvents".nativeClassAL("SOFT_events") { + documentation = + """ + Native bindings to the $specLinkOpenALSoft extension. + + This extension provides a method for applications to receive notifications about audio events via an asynchronous callback. This can help alleviate the + need for applications to continually poll the AL to check if an event happened, and instead allow them to respond when events happen. Such events can + include a source changing state or a device becoming disconnected. + """ + + IntConstant( + "Accepted as the {@code pname} parameter of #GetPointerSOFT() and #GetPointervSOFT().", + + "EVENT_CALLBACK_FUNCTION_SOFT"..0x19A2, + "EVENT_CALLBACK_USER_PARAM_SOFT"..0x19A3 + ) + + IntConstant( + """ + Accepted as an element in the {@code types} parameter of #EventControlSOFT(), and provided as the {@code eventType} parameter of + {@code ALEVENTPROCSOFT} callback functions. + """, + + "EVENT_TYPE_BUFFER_COMPLETED_SOFT"..0x19A4, + "EVENT_TYPE_SOURCE_STATE_CHANGED_SOFT"..0x19A5, + "EVENT_TYPE_DISCONNECTED_SOFT"..0x19A6 + ) + + void( + "EventControlSOFT", + "", + + AutoSize("types")..ALsizei("count", ""), + ALenum.const.p("types", ""), + ALboolean("enable", "") + ) + + void( + "EventCallbackSOFT", + "", + + ALEVENTPROCSOFT("callback", ""), + Unsafe..nullable..ALvoid.p("userParam", "") + ) + + "ALvoid".opaque.p( + "GetPointerSOFT", + "", + + ALenum("pname", "") + ) + + void( + "GetPointervSOFT", + "", + + ALenum("pname", ""), + Check(1)..ALvoid.p.p("values", "") + ) +} \ No newline at end of file