当前位置: 首页>>代码示例>>Java>>正文


Java AL.destroy方法代码示例

本文整理汇总了Java中org.lwjgl.openal.AL.destroy方法的典型用法代码示例。如果您正苦于以下问题:Java AL.destroy方法的具体用法?Java AL.destroy怎么用?Java AL.destroy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.lwjgl.openal.AL的用法示例。


在下文中一共展示了AL.destroy方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: destroy

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
/**
 * Destroy this SoundManager
 */
public void destroy() {
  if(soundOutput) {

    // stop playing sounds
    scratchBuffer.position(0).limit(sources.length);
    scratchBuffer.put(sources).flip();
    AL10.alSourceStop(scratchBuffer);

    // destroy sources
    AL10.alDeleteSources(scratchBuffer);

    // destroy buffers
    scratchBuffer.position(0).limit(bufferIndex);
    scratchBuffer.put(buffers, 0, bufferIndex).flip();
    AL10.alDeleteBuffers(scratchBuffer);

    // destory OpenAL
  	AL.destroy();
  }
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:24,代码来源:SoundManager.java

示例2: execute

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
/**
 * Runs the actual test, using supplied arguments
 */
protected void execute(String[] args) {
	try {
		AL.create(null, -1, 60, false);
		checkForErrors();
	} catch (LWJGLException le) {
		die("Init", le.getMessage());
	}

	printALCInfo();
	printALInfo();
	printEFXInfo();

	checkForErrors();

	AL.destroy();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:20,代码来源:OpenALInfo.java

示例3: stop

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void stop() {
	int lastError;

       //stop source 0
       AL10.alSourceStop(sources.get(0));
       if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
           exit(lastError);
       }

       //delete buffers and sources
       sources.position(0).limit(1);
       AL10.alDeleteSources(sources);
       if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
           exit(lastError);
       }

       buffers.position(0).limit(1);
       AL10.alDeleteBuffers(buffers);
       if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) {
           exit(lastError);
       }

       AL.destroy();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:25,代码来源:OpenAL.java

示例4: cleanupInThread

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void cleanupInThread(){
    if (audioDisabled){
        AL.destroy();
        return;
    }

    // delete channel-based sources
    ib.clear();
    ib.put(channels);
    ib.flip();
    alDeleteSources(ib);

    if (supportEfx){
        ib.position(0).limit(1);
        ib.put(0, reverbFx);
        EFX10.alDeleteEffects(ib);

        ib.position(0).limit(1);
        ib.put(0, reverbFxSlot);
        EFX10.alDeleteAuxiliaryEffectSlots(ib);
    }

    // XXX: Delete other buffers/sources
    AL.destroy();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:26,代码来源:LwjglAudioRenderer.java

示例5: dispose

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void dispose () {
	if (noDevice) return;
	for (int i = 0, n = allSources.size; i < n; i++) {
		int sourceID = allSources.get(i);
		int state = alGetSourcei(sourceID, AL_SOURCE_STATE);
		if (state != AL_STOPPED) alSourceStop(sourceID);
		alDeleteSources(sourceID);
	}

	sourceToSoundId.clear();
	soundIdToSource.clear();

	AL.destroy();
	while (AL.isCreated()) {
		try {
			Thread.sleep(10);
		} catch (InterruptedException e) {
		}
	}
}
 
开发者ID:Xemiru,项目名称:Undertailor,代码行数:21,代码来源:OpenALAudio.java

示例6: loop

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
@Override
public void loop() {
	while(!Display.isCloseRequested()) {
		final long time = System.nanoTime();
		glClear(GL_COLOR_BUFFER_BIT |
		        GL_DEPTH_BUFFER_BIT |
		        GL_STENCIL_BUFFER_BIT);
		glClearDepth(1.0f);
		getInput();
		glPushMatrix();
			currentStage.beginStep(emptyList());
			currentStage.onStep();
			currentStage.processAddStack();
			currentStage.processRemoveStack();
			Renderer.getCamera().lookThrough();
			currentStage.render();
			currentStage.endStep();
		glPopMatrix();
		Display.update();
		timeDelta = System.nanoTime()-time;
	}
	AL.destroy();
	Display.destroy();
}
 
开发者ID:eliatlarge,项目名称:FEMultiPlayer-V2,代码行数:25,代码来源:LevelEditor.java

示例7: cleanUp

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void cleanUp() {
	Set<String> keys = sourcesMap.keySet();
	Iterator<String> iter = keys.iterator();

	String name;
	IntBuffer buffer, source;
	while (iter.hasNext()) {
		name = iter.next();

		source = sourcesMap.get(name);
		System.out.println("Stopping " + name);
		AL10.alSourceStop(source);
		AL10.alDeleteSources(source);

		buffer = buffersMap.get(name);
		AL10.alDeleteBuffers(buffer);
	}
	AL.destroy();
}
 
开发者ID:Radseq,项目名称:Mystic-Bastion,代码行数:20,代码来源:SoundManager.java

示例8: close

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void close() {
	if(!closed.compareAndSet(false, true))
		return;
	
	try{
		for(AudioStateListener listener:audioStateListeners)
		{
			try{
				listener.close();
			}catch(Exception e)
			{
				StateManager.logError(e);
			}
		}
	}finally{
		this.exec.shutdown();
		
	    if(AL.isCreated()) {
		      AL.destroy();
		 }
	}
}
 
开发者ID:sambayless,项目名称:golems,代码行数:23,代码来源:ALAudioManager.java

示例9: GameCo

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public GameCo(){ //My initialization code
	initGL();
	initFont();
	lastFPS = getTime();
	
	//if(gamesave = found) loadgame; else newGame();
	newGame();
	
	BackgroundTex = loadTexture("grass");
			
	conWind = new Window(100, 100, 800, 600, this);
	buyWind = new Window(8, 180, 128, 256, this);
	
	//gameLoop();
	while (!Display.isCloseRequested()){
		gameLoop();
	}
	Display.destroy();
       AL.destroy();
       System.exit(0);
}
 
开发者ID:Fireblade,项目名称:GameCo,代码行数:22,代码来源:GameCo.java

示例10: destroy

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public final void destroy()
{
	gameNetCode.closeLink();
	gameNetLinkLobby.closeLink();

	if (gameEngine != null)
	{
		gameEngine.Destroy();
		gameEngine = null;
	}

	try
	{
		AL.destroy();
	}
	catch (Throwable t)
	{

	}

	if (CloseMessage != null)
	{
		JOptionPane.showMessageDialog(null, CloseMessage);
	}

	System.exit(0);
}
 
开发者ID:TheRemote,项目名称:Spark,代码行数:28,代码来源:Spark.java

示例11: main

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public static void main(String[] args) throws FileNotFoundException {
    try {
        Display.setDisplayMode(new DisplayMode(640, 480));
        Display.setTitle("OpenAL Demo");
        Display.create();
        AL.create();
    } catch (LWJGLException e) {
        e.printStackTrace();
        Display.destroy();
        AL.destroy();
        System.exit(1);
    }
    WaveData data = WaveData.create(new BufferedInputStream(new FileInputStream("res" + File.separatorChar +
            "sounds" + File.separatorChar + "thump.wav")));
    int buffer = alGenBuffers();
    alBufferData(buffer, data.format, data.data, data.samplerate);
    data.dispose();
    int source = alGenSources();
    alSourcei(source, AL_BUFFER, buffer);
    while (!Display.isCloseRequested()) {
        while (Keyboard.next()) {
            if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)) {
                alSourcePlay(source);
            }
        }
        Display.update();
        Display.sync(60);
    }
    alDeleteBuffers(buffer);
    AL.destroy();
    Display.destroy();
    System.exit(0);
}
 
开发者ID:nitrodragon,项目名称:lwjgl_collection,代码行数:34,代码来源:OpenALDemo.java

示例12: destroy

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
@Override
public void destroy() {
    try {
        if (AL.isCreated()) {
            for (int i = 0; i < music.size(); i++) {
                MusicController musicControllerImpl = music.get(i);
                if (musicControllerImpl != null) {
                    musicControllerImpl.release();
                }
            }
            for (int i = 0, n = allSources.size; i < n; i++) {
                int sourceID = allSources.get(i);
                int state = AL10.alGetSourcei(sourceID, AL10.AL_SOURCE_STATE);
                if (state != AL10.AL_STOPPED) AL10.alSourceStop(sourceID);
                AL10.alDeleteSources(sourceID);
            }
            sourceToSoundId.clear();
            soundIdToSource.clear();
            AL.destroy();
            while (AL.isCreated()) {
                try {
                    Thread.sleep(10);
                } catch (InterruptedException skip) {
                    skip.printStackTrace();
                }
            }
        }
    } catch (UnsatisfiedLinkError e) {
        e.printStackTrace();
    }
}
 
开发者ID:dmitrykolesnikovich,项目名称:featurea,代码行数:32,代码来源:OpenALImpl.java

示例13: cleanup

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
/**
 * Do any game-specific cleanup
 */
private static void cleanup() {
	// TODO: save anything you want to disk here

	// Stop the sound
	AL.destroy();

	// Close the window
	Display.destroy();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:13,代码来源:Game.java

示例14: shutdown

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
/**
 * Shutdown of demonstration
 */
private void shutdown() {
  LWJGLUtil.log("Shutting down OpenAL");
  alSourceStop(soundSources);
  alDeleteSources(soundSources);
  alDeleteBuffers(soundBuffers);
  AL.destroy();

  LWJGLUtil.log("Shutting down Window");
  Display.destroy();
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:14,代码来源:PositionTest.java

示例15: shutDown

import org.lwjgl.openal.AL; //导入方法依赖的package包/类
public void shutDown()
{
    for( int i = 0; i < names.size(); i++ )
    {
        samples.get( names.get(i) ).destroy();
    }
    AL.destroy();
}
 
开发者ID:relminator,项目名称:AnyaBasic,代码行数:9,代码来源:Sonics.java


注:本文中的org.lwjgl.openal.AL.destroy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。