我正在尝试让自己参与到 Libgdx OpenGL 框架中.我使用 LwjglApplication
创建了一些简单的应用程序来渲染盒子、一些网格和一些纹理.我遇到了 Aurelien Ribon 的创建刚性 Box2D 物体的应用程序.他使用 LwjglCanvas
与 Java 的 Swing 集成.我尝试自己制作一个,我创建了一个 JFrame
然后添加了 LwjglCanvas
.然后将JFrame
的默认操作设置为接近EXIT_ON_CLOSE
.
I'm trying to engage myself into the Libgdx OpenGL framework. I've used LwjglApplication
for creating some simple apps that render boxes, some meshes and some textures. I came across Aurelien Ribon's app that creates rigid Box2D bodies. He used the LwjglCanvas
to integrate with Java's Swing. I tried making one myself, I created a JFrame
then added the LwjglCanvas
. Then set the JFrame
's default operation on close to EXIT_ON_CLOSE
.
但是,每次我关闭应用程序时,都会记录到我的控制台:
However everytime I close the application, this logs to my console:
AL lib: alc_cleanup: 1 个设备未关闭
.
我不知道这意味着什么,它对我没有任何伤害.我只是想知道这意味着什么.根据 LwjglCanvas
文档:
I don't know what it means and it's not doing me any harm. I just want to know what it means. According to LwjglCanvas
docs:
所有 OpenGL 调用都在 EDT 上完成.这比专用线程效率略低,但大大简化了同步.请注意,由于 LWJGL 和/或 Swing 处理关闭挂钩的方式,您可能需要调用 stop() 或 Swing 应用程序可能会在 System.exit 上死锁.
我应该在哪里绑定 LwjglCanvas.stop()
,应该将它添加到 EventDispatchThread
队列还是应该将它绑定到 JFrame.addWindowListener代码>?
Where should I bind the LwjglCanvas.stop()
, should I add it to the EventDispatchThread
queue or should I bind it to the JFrame.addWindowListener
?
AL lib: alc_cleanup: 1 device not closed"到底是什么意思?
And what does "AL lib: alc_cleanup: 1 device not closed" really mean?
非常感谢!
AL lib 是 Libgdx(OpenAL 变体之一)使用的音频库".
The AL lib is the "audio library" used by Libgdx (one of the OpenAL variants).
我相信这条消息只是意味着音频库正在为您清理一些(在您的情况下只是一个)音频流/句柄.如果您在退出时看到它,它是无害的,因为所有资源都将被操作系统清理.
I believe this message just means that the audio library is cleaning up some (in your case just one) audio streams/handles for you. If you see this at exit, its harmless as all resources will be cleaned up by the OS.
如果您在退出之前在内部清理了音频,则该消息应该会消失.
If you internally cleanup your audio before exiting, the message should go away.
欲了解更多详情,请在此处查找 alc_cleanup
:http://repo.or.cz/w/openal-soft.git/blob/HEAD:/Alc/ALc.c
For more details, look for alc_cleanup
in here:
http://repo.or.cz/w/openal-soft.git/blob/HEAD:/Alc/ALc.c
这篇关于“AL lib:alc_cleanup:1 个设备未关闭"是什么意思?意思是?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!