Package net.java.games.joal

Examples of net.java.games.joal.ALException


     * @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);
View Full Code Here

TOP

Related Classes of net.java.games.joal.ALException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.