Skip to content

Commit

Permalink
use device 0 when AL.alcDevice is null, destoryed or no device available
Browse files Browse the repository at this point in the history
  • Loading branch information
Ecdcaeb authored Feb 20, 2025
1 parent c7a1cf5 commit eb27e96
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/org/lwjglx/openal/ALC10.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ public class ALC10 {

public static int alcGetError(ALCdevice device) {
if (device == null) {
if (AL.alcDevice == null) {
return org.lwjgl3.openal.ALC10.alcGetError(0);
}
return org.lwjgl3.openal.ALC10.alcGetError(AL.alcDevice.device);
}

Expand All @@ -21,6 +24,9 @@ public static int alcGetError(ALCdevice device) {

public static java.lang.String alcGetString(ALCdevice device, int pname) {
if (device == null) {
if (AL.alcDevice == null) {
return org.lwjgl3.openal.ALC10.alcGetString(0, pname);
}
return org.lwjgl3.openal.ALC10.alcGetString(AL.alcDevice.device, pname);
}

Expand All @@ -37,6 +43,9 @@ public static ALCdevice alcOpenDevice(String devicename) {

public static boolean alcIsExtensionPresent(ALCdevice device, java.lang.String extName) {
if (device == null) {
if (AL.alcDevice == null) {
return org.lwjgl3.openal.ALC10.alcIsExtensionPresent(0, extName);
}
return org.lwjgl3.openal.ALC10.alcIsExtensionPresent(AL.alcDevice.device, extName);
}

Expand Down

0 comments on commit eb27e96

Please sign in to comment.