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


Java AL10.alDeleteBuffers方法代碼示例

本文整理匯總了Java中org.lwjgl.openal.AL10.alDeleteBuffers方法的典型用法代碼示例。如果您正苦於以下問題:Java AL10.alDeleteBuffers方法的具體用法?Java AL10.alDeleteBuffers怎麽用?Java AL10.alDeleteBuffers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.lwjgl.openal.AL10的用法示例。


在下文中一共展示了AL10.alDeleteBuffers方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: play

import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
/**
    * Play a mod or xm track streamed from the specified location
    * 
    * @param module The moudle to play back
    * @param source The OpenAL source to play the music on
    * @param start True if the music should be started
    * @param loop True if the track should be looped
    */
public void play(Module module, int source, boolean loop, boolean start) {
	this.source = source;
	this.loop = loop;
	this.module = module;
	done = false;
	
	ibxm = new IBXM(48000);
	ibxm.set_module(module);
	songDuration = ibxm.calculate_song_duration();

	if (bufferNames != null) {
		AL10.alSourceStop(source);
		bufferNames.flip();
		AL10.alDeleteBuffers(bufferNames);
	}
	
	bufferNames = BufferUtils.createIntBuffer(2);
	AL10.alGenBuffers(bufferNames);
	remainingBufferCount = 2;
	
	for (int i=0;i<2;i++) {
        stream(bufferNames.get(i));
	}
       AL10.alSourceQueueBuffers(source, bufferNames);
	AL10.alSourcef(source, AL10.AL_PITCH, 1.0f);
	AL10.alSourcef(source, AL10.AL_GAIN, 1.0f); 
	
	if (start) {
		AL10.alSourcePlay(source);
	}
}
 
開發者ID:SkidJava,項目名稱:BaseClient,代碼行數:40,代碼來源:OpenALMODPlayer.java

示例2: releaseAllStreams

import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
@Override
public void releaseAllStreams() {
    if (bufferID != -1) {
        audioFactory.freeBuffer(bufferID);
        AL10.alDeleteBuffers(bufferID);
        bufferID = -1;
        audioFactory.forget(this);
    }
}
 
開發者ID:dmitrykolesnikovich,項目名稱:featurea,代碼行數:10,代碼來源:SoundPoolImpl.java

示例3: release

import org.lwjgl.openal.AL10; //導入方法依賴的package包/類
@Override
public void release() {
    if (buffers == null) return;
    if (sourceID != -1) {
        reset();
        player.music.remove(this);
        player.freeSource(sourceID);
        sourceID = -1;
    }
    AL10.alDeleteBuffers(buffers);
    buffers = null;
}
 
開發者ID:dmitrykolesnikovich,項目名稱:featurea,代碼行數:13,代碼來源:MusicControllerImpl.java


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