当前位置: 首页>>代码示例>>Java>>正文


Java AL.isCreated方法代码示例

本文整理汇总了Java中org.lwjgl.openal.AL.isCreated方法的典型用法代码示例。如果您正苦于以下问题:Java AL.isCreated方法的具体用法?Java AL.isCreated怎么用?Java AL.isCreated使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.openal.AL的用法示例。


在下文中一共展示了AL.isCreated方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
@Override
public void init() {
    if (!AL.isCreated()) {
        try {
            AL.create();
        } catch (LWJGLException e) {
            e.printStackTrace();
        }
        allSources = new IntArray(SIMULTANEOUS_SOURCES_COUNT);
        for (int i = 0; i < SIMULTANEOUS_SOURCES_COUNT; i++) {
            int sourceID = AL10.alGenSources();
            if (AL10.alGetError() == AL10.AL_NO_ERROR) {
                allSources.add(sourceID);
            }
        }
        idleSources = new IntArray(allSources);
        recentSounds = new SoundPoolImpl[SIMULTANEOUS_SOURCES_COUNT];
        AL10.alListener(AL10.AL_ORIENTATION, orientation);
        AL10.alListener(AL10.AL_VELOCITY, velocity);
        AL10.alListener(AL10.AL_POSITION, position);
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:23,代码来源:OpenALImpl.java

示例2: dispose

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void dispose () {
	if (noDevice) return;
	for (int i = 0, n = allSources.size; i < n; i++) {
		int sourceID = allSources.get(i);
		int state = alGetSourcei(sourceID, AL_SOURCE_STATE);
		if (state != AL_STOPPED) alSourceStop(sourceID);
		alDeleteSources(sourceID);
	}

	sourceToSoundId.clear();
	soundIdToSource.clear();

	AL.destroy();
	while (AL.isCreated()) {
		try {
			Thread.sleep(10);
		} catch (InterruptedException e) {
		}
	}
}
 
开发者ID:Xemiru,项目名称:Undertailor,代码行数:21,代码来源:OpenALAudio.java

示例3: close

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void close() {
	if(!closed.compareAndSet(false, true))
		return;
	
	try{
		for(AudioStateListener listener:audioStateListeners)
		{
			try{
				listener.close();
			}catch(Exception e)
			{
				StateManager.logError(e);
			}
		}
	}finally{
		this.exec.shutdown();
		
	    if(AL.isCreated()) {
		      AL.destroy();
		 }
	}
}
 
开发者ID:sambayless,项目名称:golems,代码行数:23,代码来源:ALAudioManager.java

示例4: dispose

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void dispose() {
    if (noDevice) {
        return;
    }
    for (int i = 0, n = allSources.size; i < n; i++) {
        int sourceID = allSources.get(i);
        int state = alGetSourcei(sourceID, AL_SOURCE_STATE);
        if (state != AL_STOPPED) {
            alSourceStop(sourceID);
        }
        alDeleteSources(sourceID);
    }

    sourceToSoundId.clear();
    soundIdToSource.clear();

    AL.destroy();
    while (AL.isCreated()) {
        try {
            Thread.sleep(10);
        } catch (InterruptedException e) {
        }
    }
}
 
开发者ID:kovertopz,项目名称:libGDX-LWJGL-Audio,代码行数:25,代码来源:OpenALAudio.java

示例5: destroy

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
@Override
public void destroy() {
    try {
        if (AL.isCreated()) {
            for (int i = 0; i < music.size(); i++) {
                MusicController musicControllerImpl = music.get(i);
                if (musicControllerImpl != null) {
                    musicControllerImpl.release();
                }
            }
            for (int i = 0, n = allSources.size; i < n; i++) {
                int sourceID = allSources.get(i);
                int state = AL10.alGetSourcei(sourceID, AL10.AL_SOURCE_STATE);
                if (state != AL10.AL_STOPPED) AL10.alSourceStop(sourceID);
                AL10.alDeleteSources(sourceID);
            }
            sourceToSoundId.clear();
            soundIdToSource.clear();
            AL.destroy();
            while (AL.isCreated()) {
                try {
                    Thread.sleep(10);
                } catch (InterruptedException skip) {
                    skip.printStackTrace();
                }
            }
        }
    } catch (UnsatisfiedLinkError e) {
        e.printStackTrace();
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:32,代码来源:OpenALImpl.java

示例6: freeSource

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void freeSource(int sourceID) {
    if (AL.isCreated()) {
        AL10.alSourceStop(sourceID);
        AL10.alSourcei(sourceID, AL10.AL_BUFFER, 0);
        if (sourceToSoundId.containsKey(sourceID)) {
            long soundId = sourceToSoundId.remove(sourceID);
            soundIdToSource.remove(soundId);
        }
        idleSources.add(sourceID);
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:12,代码来源:OpenALImpl.java

示例7: freeBuffer

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void freeBuffer(int bufferID) {
    if (AL.isCreated()) {
        for (int i = 0, n = idleSources.size; i < n; i++) {
            int sourceID = idleSources.get(i);
            if (AL10.alGetSourcei(sourceID, AL10.AL_BUFFER) == bufferID) {
                if (sourceToSoundId.containsKey(sourceID)) {
                    long soundId = sourceToSoundId.remove(sourceID);
                    soundIdToSource.remove(soundId);
                }
                AL10.alSourceStop(sourceID);
                AL10.alSourcei(sourceID, AL10.AL_BUFFER, 0);
            }
        }
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:16,代码来源:OpenALImpl.java

示例8: stopSourcesWithBuffer

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void stopSourcesWithBuffer(int bufferID) {
    if (AL.isCreated()) {
        for (int i = 0, n = idleSources.size; i < n; i++) {
            int sourceID = idleSources.get(i);
            if (AL10.alGetSourcei(sourceID, AL10.AL_BUFFER) == bufferID) {
                if (sourceToSoundId.containsKey(sourceID)) {
                    long soundId = sourceToSoundId.remove(sourceID);
                    soundIdToSource.remove(soundId);
                }
                AL10.alSourceStop(sourceID);
            }
        }
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:15,代码来源:OpenALImpl.java

示例9: pauseSourcesWithBuffer

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void pauseSourcesWithBuffer(int bufferID) {
    if (AL.isCreated()) {
        for (int i = 0, n = idleSources.size; i < n; i++) {
            int sourceID = idleSources.get(i);
            if (AL10.alGetSourcei(sourceID, AL10.AL_BUFFER) == bufferID) {
                AL10.alSourcePause(sourceID);
            }
        }
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:11,代码来源:OpenALImpl.java

示例10: resumeSourcesWithBuffer

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void resumeSourcesWithBuffer(int bufferID) {
    if (AL.isCreated()) {
        for (int i = 0, n = idleSources.size; i < n; i++) {
            int sourceID = idleSources.get(i);
            if (AL10.alGetSourcei(sourceID, AL10.AL_BUFFER) == bufferID) {
                if (AL10.alGetSourcei(sourceID, AL10.AL_SOURCE_STATE) == AL10.AL_PAUSED) {
                    AL10.alSourcePlay(sourceID);
                }
            }
        }
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:13,代码来源:OpenALImpl.java

示例11: update

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void update() {
    if (AL.isCreated()) {
        for (int i = 0; i < music.size(); i++) {
            MusicControllerImpl musicControllerImpl = music.get(i);
            if (musicControllerImpl != null) {
                musicControllerImpl.update();
            }
        }
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:11,代码来源:OpenALImpl.java

示例12: stopSound

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void stopSound(long soundId) {
    if (AL.isCreated()) {
        if (soundIdToSource.containsKey(soundId)) {
            int sourceId = soundIdToSource.get(soundId);
            AL10.alSourceStop(sourceId);
        }
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:9,代码来源:OpenALImpl.java

示例13: pauseSound

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void pauseSound(long soundId) {
    if (AL.isCreated()) {
        if (soundIdToSource.containsKey(soundId)) {
            int sourceId = soundIdToSource.get(soundId);
            AL10.alSourcePause(sourceId);
        }
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:9,代码来源:OpenALImpl.java

示例14: resumeSound

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void resumeSound(long soundId) {
    if (AL.isCreated()) {
        if (soundIdToSource.containsKey(soundId)) {
            int sourceId = soundIdToSource.get(soundId);
            if (AL10.alGetSourcei(sourceId, AL10.AL_SOURCE_STATE) == AL10.AL_PAUSED) {
                AL10.alSourcePlay(sourceId);
            }
        }
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:11,代码来源:OpenALImpl.java

示例15: setSoundGain

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void setSoundGain(long soundId, double volume) {
    if (AL.isCreated()) {
        if (soundIdToSource.containsKey(soundId)) {
            int sourceId = soundIdToSource.get(soundId);
            AL10.alSourcef(sourceId, AL10.AL_GAIN, (float) volume);
        }
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:9,代码来源:OpenALImpl.java


注:本文中的org.lwjgl.openal.AL.isCreated方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。