本文整理匯總了Java中org.lwjgl.openal.AL10.AL_NO_ERROR屬性的典型用法代碼示例。如果您正苦於以下問題:Java AL10.AL_NO_ERROR屬性的具體用法?Java AL10.AL_NO_ERROR怎麽用?Java AL10.AL_NO_ERROR使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.lwjgl.openal.AL10
的用法示例。
在下文中一共展示了AL10.AL_NO_ERROR屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
/**
* Initialise OpenAL LWJGL styley
*/
public void init() {
try {
AL.create();
soundWorks = true;
} catch (LWJGLException e) {
System.err.println("Failed to initialise LWJGL OpenAL");
soundWorks = false;
return;
}
if (soundWorks) {
IntBuffer sources = BufferUtils.createIntBuffer(1);
AL10.alGenSources(sources);
if (AL10.alGetError() != AL10.AL_NO_ERROR) {
System.err.println("Failed to create sources");
soundWorks = false;
} else {
source = sources.get(0);
}
}
}
示例2: init
@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);
}
}
示例3: Source
public Source(Sound sound){
this.sound = sound;
AL10.alSourcei(id, AL10.AL_BUFFER, sound.id);
if(AL10.alGetError() != AL10.AL_NO_ERROR)
System.err.println("AL ERROR");
}
示例4: play
@Override
public void play() {
if (sourceID == -1) {
sourceID = player.obtainSource(true);
if (sourceID == -1) return;
if (buffers == null) {
buffers = BufferUtils.createIntBuffer(bufferCount);
AL10.alGenBuffers(buffers);
if (AL10.alGetError() != AL10.AL_NO_ERROR)
throw new RuntimeException("Unable to allocate audio buffers.");
}
AL10.alSourcei(sourceID, AL10.AL_LOOPING, AL10.AL_FALSE);
int filled = 0;
for (int i = 0; i < bufferCount; i++) {
int bufferID = buffers.get(i);
if (!fill(bufferID)) break;
filled++;
AL10.alSourceQueueBuffers(sourceID, bufferID);
}
if (filled == 0) {
}
if (AL10.alGetError() != AL10.AL_NO_ERROR) {
System.err.println("alGetError = " + AL10.alGetError());
}
}
AL10.alSourcePlay(sourceID);
isPlaying = true;
player.reload();
}
示例5: checkError
public void checkError(){
int error = AL10.alGetError();
if(error == AL10.AL_NO_ERROR)
return;
Application.error(AL10.alGetString(error));
}