本文整理汇总了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);
}
}
示例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) {
}
}
}
示例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();
}
}
}
示例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) {
}
}
}
示例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();
}
}
示例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);
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
}
}
示例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();
}
}
}
}
示例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);
}
}
}
示例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);
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}