本文整理汇总了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();
}
}
示例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();
}
示例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();
}
示例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();
}
示例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) {
}
}
}
示例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();
}
示例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();
}
示例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();
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
}
示例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();
}
示例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();
}
示例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();
}