com.jme3.audio.openal.ALUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jme3-core Show documentation
Show all versions of jme3-core Show documentation
jMonkeyEngine is a 3-D game engine for adventurous Java developers
The newest version!
package com.jme3.audio.openal;
import static com.jme3.audio.openal.AL.*;
public final class ALUtil {
private ALUtil() {
}
public static String getALErrorMessage(int errorCode) {
String errorText;
switch (errorCode) {
case AL_NO_ERROR:
errorText = "No Error";
break;
case AL_INVALID_NAME:
errorText = "Invalid Name";
break;
case AL_INVALID_ENUM:
errorText = "Invalid Enum";
break;
case AL_INVALID_VALUE:
errorText = "Invalid Value";
break;
case AL_INVALID_OPERATION:
errorText = "Invalid Operation";
break;
case AL_OUT_OF_MEMORY:
errorText = "Out of Memory";
break;
default:
errorText = "Unknown Error Code: " + errorCode;
break;
}
return errorText;
}
public static void checkALError(AL al) {
int err = al.alGetError();
if (err != AL_NO_ERROR) {
throw new RuntimeException("OpenAL Error: " + getALErrorMessage(err));
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy