SFML community forums

Help => Window => Topic started by: shahn on November 19, 2010, 04:35:23 pm

Title: getting game pad events without showing a window
Post by: shahn on November 19, 2010, 04:35:23 pm
I want to use SFML for platform-independent gamepad support, but I already have a working GUI using Qt. I looked at the Qt sample in SFML-1.6, which seems to be very close to what I want.

Question 1: Does this still work with SFML-2 from svn? More specifically: Is SFML's WindowHandle type still compatible with Qt's WId type? On all supported platforms? (This is at least how I understand the usage in the 1.6 sample.)

Question 2: Is this possible at all? I think, I would need to create a Window-object, that does not open an actual window on the screen, nor creates an openGL-context.

Any insight appreciated.
Title: getting game pad events without showing a window
Post by: Laurent on November 19, 2010, 04:46:29 pm
Quote
Question 1: Does this still work with SFML-2 from svn? More specifically: Is SFML's WindowHandle type still compatible with Qt's WId type? On all supported platforms? (This is at least how I understand the usage in the 1.6 sample.)

Yes it is.

Quote
Question 2: Is this possible at all? I think, I would need to create a Window-object, that does not open an actual window on the screen, nor creates an openGL-context.

SFML is not made for that, the input stuff is not independant. I'm sure you can find dedicated IO libraries, like OIS. And what about Qt, it doesn't handle joysticks at all?
Title: getting game pad events without showing a window
Post by: shahn on November 19, 2010, 05:09:28 pm
Quote
SFML is not made for that, the input stuff is not independant. I'm sure you can find dedicated IO libraries, like OIS. And what about Qt, it doesn't handle joysticks at all?

Qt doesn't handle joysticks at all :(. Our project already uses SFML for audio output, so I thought it would be natural to use it for gamepad stuff, too. But I am going to look at OIS...

Thanks for the quick reply.
Title: getting game pad events without showing a window
Post by: shahn on November 22, 2010, 06:42:49 pm
I've tried to create an SFML window using a Qt-winId-handle, without opening a GLContext via SFML. So far, it seems to work, to get the gamepad events via sf::Window::GetEvent().

Quote
SFML is not made for that, the input stuff is not independant.


Apart from SFML not being made for this, is there anything stopping me from doing that? That you can think of?
Title: getting game pad events without showing a window
Post by: Laurent on November 22, 2010, 06:55:42 pm
Quote
without opening a GLContext via SFML

You can't, every SFML window has a GL context.

Quote
Apart from SFML not being made for this, is there anything stopping me from doing that? That you can think of?

No :)