开发者

Event Handling API's to Use with OpenGL

开发者 https://www.devze.com 2023-03-26 05:03 出处:网络
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 require

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 bin开发者_StackOverflow中文版ding 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.


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 (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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号