* @return true, if successful (does not care if EAX is supported & has
* succeeded).
*/
public boolean init(String deviceName, boolean attemptEAX) {
if (context != null) {
throw new ALException("OpenAL already initialized");
}
if (al == null) {
al = ALFactory.getAL();
}
if (alc == null) {
alc = ALFactory.getALC();
}
ALCdevice d = alc.alcOpenDevice(deviceName);
if (d == null) {
throw new ALException("Error opening default OpenAL device");
}
ALCcontext c = alc.alcCreateContext(d, null);
if (c == null) {
alc.alcCloseDevice(d);
throw new ALException("Error creating OpenAL context");
}
alc.alcMakeContextCurrent(c);
if (alc.alcGetError(d) != 0) {
alc.alcDestroyContext(c);
alc.alcCloseDevice(d);
throw new ALException("Error making OpenAL context current");
}
// Fully initialized; finish setup
device = d;
context = c;
isInited = (al.alGetError() == AL.AL_NO_ERROR);