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

Author Topic: Joystick questions  (Read 3168 times)

0 Members and 1 Guest are viewing this topic.

Bravepower

  • Newbie
  • *
  • Posts: 4
    • View Profile
Joystick questions
« on: September 21, 2009, 10:18:24 am »
Hi, I've been learning SFML for a short while now and I'm not sure how to use joysticks. There isn't much information for them on the website or wiki.

How do you query the available joysticks in SFML 1.5 (if possible)? Can SFML be used to detect if joysticks are plugged in/unplugged during runtime?

I notice there is a class called sf::priv::Joystick in the OS-specific joystick.hpp files, yet it is not used anywhere in the code apart from its declaration. Can I use that class or is it only partially implemented? If it is meant to be used, how do we use it? Also, what is the sf::priv namespace for?

Also can SFML support more than 2 joysticks? I know DirectInput supports more than 2 joysticks, but I'm not sure if it can be done using just win32 (or on other operating systems).

Sorry for all the questions and thanks for your time.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Joystick questions
« Reply #1 on: September 21, 2009, 02:46:29 pm »
Hi

Quote
There isn't much information for them on the website or wiki.

Everything that you can use is there ;)

Quote
How do you query the available joysticks in SFML 1.5 (if possible)?

You can't.

Quote
Can SFML be used to detect if joysticks are plugged in/unplugged during runtime?

No.

Quote
I notice there is a class called sf::priv::Joystick in the OS-specific joystick.hpp files, yet it is not used anywhere in the code apart from its declaration. Can I use that class or is it only partially implemented? If it is meant to be used, how do we use it? Also, what is the sf::priv namespace for?

It's not meant to be used, sf::priv means private.

Quote
Also can SFML support more than 2 joysticks?

No.
Laurent Gomila - SFML developer

Bravepower

  • Newbie
  • *
  • Posts: 4
    • View Profile
Joystick questions
« Reply #2 on: September 21, 2009, 07:20:46 pm »
Hi Laurent, thanks for your prompt answers.

I'm just curious, when does SFML use sf::priv::Joystick? Is it just obsolete code or will it be used in SFML 2?

I guess I will just have to assume that 2 joysticks are already plugged in when the program is executed. Thanks again.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Joystick questions
« Reply #3 on: September 21, 2009, 08:15:36 pm »
sf::priv::Joystick is used in sf::priv::WindowImpl.
Laurent Gomila - SFML developer

 

anything