Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: getting game pad events without showing a window  (Read 3061 times)

0 Members and 1 Guest are viewing this topic.

shahn

  • Newbie
  • *
  • Posts: 16
    • View Profile
getting game pad events without showing a window
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
getting game pad events without showing a window
« Reply #1 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?
Laurent Gomila - SFML developer

shahn

  • Newbie
  • *
  • Posts: 16
    • View Profile
getting game pad events without showing a window
« Reply #2 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.

shahn

  • Newbie
  • *
  • Posts: 16
    • View Profile
getting game pad events without showing a window
« Reply #3 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?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
getting game pad events without showing a window
« Reply #4 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 :)
Laurent Gomila - SFML developer