當前位置: 首頁>>代碼示例>>Java>>正文


Java AL10.alGetError方法代碼示例

本文整理匯總了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);
	}
	
}
  }
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:27,代碼來源:OpenALMODPlayer.java

示例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);
    }
}
 
開發者ID:dmitrykolesnikovich,項目名稱:featurea,代碼行數:23,代碼來源:OpenALImpl.java

示例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;
	}
}
 
開發者ID:sonicether,項目名稱:Sound-Physics,代碼行數:26,代碼來源:SoundPhysics.java

示例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;
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:13,代碼來源:AudioImpl.java

示例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");
}
 
開發者ID:tek256,項目名稱:LD38,代碼行數:9,代碼來源:Source.java

示例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();
}
 
開發者ID:dmitrykolesnikovich,項目名稱:featurea,代碼行數:30,代碼來源:MusicControllerImpl.java

示例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));
}
 
開發者ID:tek256,項目名稱:LD38,代碼行數:7,代碼來源:Mixer.java


注:本文中的org.lwjgl.openal.AL10.alGetError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。