Skip to content

Commit

Permalink
feat(openal) update to 1.23.0 & add new extensions
Browse files Browse the repository at this point in the history
- ALC_SOFT_loopback_bformat
- AL_SOFT_effect_target
- AL_SOFT_events

Close #854
  • Loading branch information
Spasi committed Feb 14, 2023
1 parent 0570a0a commit dc4fd14
Show file tree
Hide file tree
Showing 14 changed files with 566 additions and 17 deletions.
5 changes: 4 additions & 1 deletion doc/notes/3.3.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
14 changes: 14 additions & 0 deletions modules/lwjgl/core/src/generated/c/org_lwjgl_system_JNI.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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. */
Expand All @@ -256,7 +267,7 @@ public final class ALCapabilities {
final PointerBuffer addresses;

ALCapabilities(FunctionProvider provider, Set<String> ext, IntFunction<PointerBuffer> bufferFactory) {
PointerBuffer caps = bufferFactory.apply(127);
PointerBuffer caps = bufferFactory.apply(131);

OpenAL10 = check_AL10(provider, caps, ext);
OpenAL11 = check_AL11(provider, caps, ext);
Expand Down Expand Up @@ -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");
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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<String> 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<String> 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"
Expand All @@ -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");
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <a target="_blank" href="https://openal-soft.org/openal-extensions/SOFT_effect_target.txt">SOFT_effect_target</a> extension.
*
* <p>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.</p>
*
* <p>Retargeting an effect slot's output to another effect slot allows chaining multiple effects to create results that aren't possible with standard EFX.</p>
*/
public final class SOFTEffectTarget {

/**
* Specifies the target effect slot for this effect slot's output.
*
* <p>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.</p>
*
* <p>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.</p>
*/
public static final int AL_EFFECTSLOT_TARGET_SOFT = 0x199C;

private SOFTEffectTarget() {}

}
Original file line number Diff line number Diff line change
@@ -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.*;

/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* ALenum eventType,
* ALuint object,
* ALuint param,
* ALsizei length,
* ALchar const *message,
* ALvoid *userParam
* )</code></pre>
*/
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);
}

}

}
Original file line number Diff line number Diff line change
@@ -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.*;

/**
* <h3>Type</h3>
*
* <pre><code>
* void (*{@link #invoke}) (
* ALenum eventType,
* ALuint object,
* ALuint param,
* ALsizei length,
* ALchar const *message,
* ALvoid *userParam
* )</code></pre>
*/
@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);

}
Loading

0 comments on commit dc4fd14

Please sign in to comment.