mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2024-11-26 11:02:47 +02:00
InputManager: SDL_NumJoysticks is a function, try calling it.
This commit is contained in:
parent
ae685a9729
commit
0cb1645c03
@ -40,14 +40,16 @@ InputManager::InputManager() {
|
|||||||
|
|
||||||
|
|
||||||
InputManager::~InputManager() {
|
InputManager::~InputManager() {
|
||||||
if (SDL_NumJoysticks > 0)
|
if (SDL_NumJoysticks() > 0) {
|
||||||
SDL_JoystickClose(joystick);
|
SDL_JoystickClose(joystick);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void InputManager::initJoystick() {
|
void InputManager::initJoystick() {
|
||||||
if (SDL_NumJoysticks > 0)
|
if (SDL_NumJoysticks() > 0) {
|
||||||
joystick = SDL_JoystickOpen(0);
|
joystick = SDL_JoystickOpen(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -132,7 +134,7 @@ bool InputManager::pollEvent(bevent_t *event) {
|
|||||||
bool InputManager::getEvent(bevent_t *bevent, bool wait) {
|
bool InputManager::getEvent(bevent_t *bevent, bool wait) {
|
||||||
//TODO: when an event is processed, program a new event
|
//TODO: when an event is processed, program a new event
|
||||||
//in some time, and when it occurs, do a key repeat
|
//in some time, and when it occurs, do a key repeat
|
||||||
|
|
||||||
SDL_JoystickUpdate();
|
SDL_JoystickUpdate();
|
||||||
SDL_Event event;
|
SDL_Event event;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user