1

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.

genpfault
  • 51,148
  • 11
  • 85
  • 139
Präriewolf
  • 829
  • 2
  • 9
  • 28
  • Pygame is based on SDL, so if Pygame is performant enough for you, then SDL will definitely be performant enough. – icktoofay Aug 07 '11 at 05:33
  • Having done a good amount of research on the topic, I chose SDL and have not seen any problems with it. – LunchMarble Aug 07 '11 at 05:36
  • @icktoofay Do you know what is going on with the display module dependency? – Präriewolf Aug 07 '11 at 05:55
  • @Prariewolf: I'm assuming that that's saying that the events part will only work if you use Pygame for displaying the graphics as well as using it for handling events. – icktoofay Aug 07 '11 at 06:12

2 Answers2

4

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.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
0

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.

ninMonkey
  • 7,211
  • 8
  • 37
  • 66