与 OpenGL 一起使用的事件处理 API
我一直在研究 OpenGL 应用程序的输入处理。我想处理至少两个操纵杆、键盘和鼠标。将其外包给 python 脚本将是一个很大的好处,但不是必需的。
- 我看了一下freeglut,不过它只支持一根摇杆。
- Pygame 说它“输入队列严重依赖于 pygame 显示模块”,所以这让我暂停了。
- 我不熟悉 QT 或 GTK 的操纵杆输入处理,并且无法找到任何简洁地描述我的问题的文档。
- SDL 的 python 绑定表示它可以“很好地”处理这些事情。 (我不知道该考虑什么。)
当我陷入 Pygame 问题时,我对 Pygame 问题的担忧是否没有意义? QT 或 GTK 可以毫无问题地提供此功能吗?还有其他选择可以解决我的问题吗?
其他一切都失败了,我想我可以直接使用SDL,但我对它的性能不太了解。
I've been looking into input handling for an OpenGL application. I want to handle at least two joysticks, keyboard, and mouse. Outsourcing this to python scripting would be a big bonus, but not required.
- I look at freeglut, but it only supports one joystick.
- Pygame says it's "input queue is heavily dependent on the pygame display module" so that caused me pause.
- I'm not familiar with QT or GTK's joystick input handling, and haven't been able to find any document describing my problem concisely.
- SDL's python binding says it handles these things "quite well". (A statement I'm not sure what to think about.)
Is my concern over the Pygame problem a moot point when I get into it? Can QT or GTK provide this functionality without issue? Is there another alternative that solves my problem?
All else fails I think I can go straight SDL, but I don't know much about it's performance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个问题实际上与 OpenGL 无关,因为 OpenGL 与输入处理关系不大。
Qt 和 wxWidgets 主要不是用来处理输入的。显然它们处理鼠标和键盘,但它们基本上是 GUI 库。他们的输入系统就是为此目的而设计和设计的。
SDL 的输入组件是为处理输入而设计的。 SFML 也是一种选择。如果这对您很重要,那么它们都具有 Python 绑定。
This question really isn't about OpenGL, as OpenGL has very little to do with input handling.
Qt and wxWidgets are not primarily for dealing with input. Obviously they handle mouse and keyboard, but they're basically GUI libraries. Their input systems are designed and intended for that purpose.
SDL's input component is designed for dealing with input. SFML is also an option. Both of them have Python bindings if that's important for you.
Pygame(使用来自 python 的 SDL)与 OpenGL 配合良好。
使用 pygame 进行输入事件、窗口创建等(跨平台的东西),并使用 OpenGL 渲染到 pygame 屏幕。
Pygame (which uses SDL, from python) works fine with OpenGL.
Use pygame for input events, window creation, etc... (the cross platform stuff) and OpenGL for rendering to the pygame screen.