int _glfwPlatformGetJoystickPos( int joy, float *pos, int numaxes ) { int i; // Is joystick present? if( !_glfwJoy[ joy ].Present ) { return 0; } // Update joystick state pollJoystickEvents(); // Does the joystick support less axes than requested? if( _glfwJoy[ joy ].NumAxes < numaxes ) { numaxes = _glfwJoy[ joy ].NumAxes; } // Copy axis positions from internal state for( i = 0; i < numaxes; ++ i ) { pos[ i ] = _glfwJoy[ joy ].Axis[ i ]; } return numaxes; }
const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count) { pollJoystickEvents(); *count = _glfw->linux_js.js[joy].buttonCount; return _glfw->linux_js.js[joy].buttons; }
const float* _glfwPlatformGetJoystickAxes(int joy, int* count) { pollJoystickEvents(); *count = _glfw->linux_js.js[joy].axisCount; return _glfw->linux_js.js[joy].axes; }
int _glfwPlatformGetJoystickButtons( int joy, unsigned char *buttons, int numbuttons ) { int i; // Is joystick present? if( !_glfwJoy[ joy ].Present ) { return 0; } // Update joystick state pollJoystickEvents(); // Does the joystick support less buttons than requested? if( _glfwJoy[ joy ].NumButtons < numbuttons ) { numbuttons = _glfwJoy[ joy ].NumButtons; } // Copy button states from internal state for( i = 0; i < numbuttons; ++ i ) { buttons[ i ] = _glfwJoy[ joy ].Button[ i ]; } return numbuttons; }
const char* _glfwPlatformGetJoystickName(int joy) { _GLFWjoystickLinux* js = _glfw.linux_js.js + joy; if (!pollJoystickEvents(js)) return NULL; return js->name; }
const float* _glfwPlatformGetJoystickAxes(int joy, int* count) { _GLFWjoystickLinux* js = _glfw.linux_js.js + joy; if (!pollJoystickEvents(js)) return NULL; *count = js->axisCount; return js->axes; }
const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count) { _GLFWjoystickLinux* js = _glfw.linux_js.js + joy; if (!pollJoystickEvents(js)) return NULL; *count = js->buttonCount; return js->buttons; }
const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count) { pollJoystickEvents(); if (!_glfw.x11.joystick[joy].present) return NULL; *count = _glfw.x11.joystick[joy].buttonCount; return _glfw.x11.joystick[joy].buttons; }
const float* _glfwPlatformGetJoystickAxes(int joy, int* count) { pollJoystickEvents(); if (!_glfw.x11.joystick[joy].present) return NULL; *count = _glfw.x11.joystick[joy].axisCount; return _glfw.x11.joystick[joy].axes; }
int _glfwPlatformGetJoystickAxes(int joy, float* axes, int numAxes) { int i; pollJoystickEvents(); if (!_glfwLibrary.X11.joystick[joy].present) return 0; if (_glfwLibrary.X11.joystick[joy].numAxes < numAxes) numAxes = _glfwLibrary.X11.joystick[joy].numAxes; for (i = 0; i < numAxes; i++) axes[i] = _glfwLibrary.X11.joystick[joy].axis[i]; return numAxes; }
int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons, int numButtons) { int i; pollJoystickEvents(); if (!_glfwLibrary.X11.joystick[joy].present) return 0; if (_glfwLibrary.X11.joystick[joy].numButtons < numButtons) numButtons = _glfwLibrary.X11.joystick[joy].numButtons; for (i = 0; i < numButtons; i++) buttons[i] = _glfwLibrary.X11.joystick[joy].button[i]; return numButtons; }
int _glfwPlatformGetJoystickParam(int joy, int param) { pollJoystickEvents(); if (!_glfwLibrary.X11.joystick[joy].present) return 0; switch (param) { case GLFW_PRESENT: return GL_TRUE; case GLFW_AXES: return _glfwLibrary.X11.joystick[joy].numAxes; case GLFW_BUTTONS: return _glfwLibrary.X11.joystick[joy].numButtons; default: _glfwSetError(GLFW_INVALID_ENUM, NULL); } return 0; }
const char* _glfwPlatformGetJoystickName(int joy) { pollJoystickEvents(); return _glfw->linux_js.js[joy].name; }
int _glfwPlatformJoystickPresent(int joy) { pollJoystickEvents(); return _glfw.x11.joystick[joy].present; }
int _glfwPlatformJoystickPresent(int joy) { pollJoystickEvents(); return _glfw->linux_js.js[joy].present; }
const char* _glfwPlatformGetJoystickName(int joy) { pollJoystickEvents(); return _glfw.x11.joystick[joy].name; }
int _glfwPlatformJoystickPresent(int joy) { _GLFWjoystickLinux* js = _glfw.linux_js.js + joy; return pollJoystickEvents(js); }