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


Java AL10.AL_NO_ERROR屬性代碼示例

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

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

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

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

示例5: checkError

public void checkError(){
	int error = AL10.alGetError();
	if(error == AL10.AL_NO_ERROR)
		return;
	Application.error(AL10.alGetString(error));
}
 
開發者ID:tek256,項目名稱:LD38,代碼行數:6,代碼來源:Mixer.java


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