本文整理匯總了Java中org.lwjgl.openal.AL10.alGetError方法的典型用法代碼示例。如果您正苦於以下問題:Java AL10.alGetError方法的具體用法?Java AL10.alGetError怎麽用?Java AL10.alGetError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.openal.AL10
的用法示例。
在下文中一共展示了AL10.alGetError方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: init
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
/**
* 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
import org.lwjgl.openal.AL10; //導入方法依賴的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);
}
}
示例3: checkErrorLog
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
protected static boolean checkErrorLog(String errorMessage)
{
int error = AL10.alGetError();
String errorName;
if (error != 0)
{
switch(error)
{
case AL10.AL_INVALID_NAME: errorName = "AL_INVALID_NAME"; break;
case AL10.AL_INVALID_ENUM: errorName = "AL_INVALID_ENUM"; break;
case AL10.AL_INVALID_VALUE: errorName = "AL_INVALID_VALUE"; break;
case AL10.AL_INVALID_OPERATION: errorName = "AL_INVALID_OPERATION"; break;
case AL10.AL_OUT_OF_MEMORY: errorName = "AL_OUT_OF_MEMORY"; break;
default: errorName = Integer.toString(error); break;
}
System.out.println(logPrefix + " [ERROR]: " + errorMessage + " OpenAL error " + errorName);
return true;
}
else
{
return false;
}
}
示例4: setPosition
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
/**
* @see org.newdawn.slick.openal.Audio#setPosition(float)
*/
public boolean setPosition(float position) {
position = position % length;
AL10.alSourcef(store.getSource(index), AL11.AL_SEC_OFFSET, position);
if (AL10.alGetError() != 0) {
return false;
}
return true;
}
示例5: Source
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
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");
}
示例6: play
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
@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();
}
示例7: checkError
import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
public void checkError(){
int error = AL10.alGetError();
if(error == AL10.AL_NO_ERROR)
return;
Application.error(AL10.alGetString(error));
}