Skip to content

Commit

Permalink
Fix context creation
Browse files Browse the repository at this point in the history
  • Loading branch information
LAGonauta committed Dec 21, 2023
1 parent 7c2a024 commit 9002fb0
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ private static long openNamedDevice(CharSequence deviceName) {

@Inject(
method = "init",
at = @At(value = "INVOKE", remap = false, target = "Lorg/lwjgl/openal/ALC10;alcMakeContextCurrent(J)Z", shift = At.Shift.BEFORE),
at = @At(value = "INVOKE", remap = false, target = "Lorg/lwjgl/openal/ALC10;alcCreateContext(JLjava/nio/IntBuffer;)J", shift = At.Shift.AFTER),
locals = LocalCapture.CAPTURE_FAILHARD
)
private void setAttr(String deviceSpecifier, boolean directionalAudio, CallbackInfo ci, ALCCapabilities aLCCapabilities) {
if (MixinAlUtilInvoker.invokeCheckAlcErrors(this.devicePointer, "creating context on device ")) {
OpenALMCMod.LOGGER.error("Some error checking initial context, continuing anyway. Context handle: {}", this.contextPointer);
}

if (this.contextPointer != 0) {
ALC10.alcDestroyContext(this.contextPointer);
this.contextPointer = 0;
Expand Down

0 comments on commit 9002fb0

Please sign in to comment.