Separated joystick state from window system state.

This is partially in preparation for pending support for additional
joystick APIs like XInput, DirectInput and IOHID.
This commit is contained in:
Camilla Berglund
2014-03-19 15:27:49 +01:00
parent 6acbfe863d
commit 660034332d
13 changed files with 214 additions and 114 deletions
+25 -11
View File
@@ -27,19 +27,33 @@
#ifndef _linux_joystick_h_
#define _linux_joystick_h_
typedef struct _GLFWjoystickLinux {
struct {
int present;
int fd;
float* axes;
int axisCount;
unsigned char* buttons;
int buttonCount;
char* name;
} joystick[GLFW_JOYSTICK_LAST + 1];
#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \
_GLFWjoystickLinux joystick[GLFW_JOYSTICK_LAST + 1]
//========================================================================
// GLFW platform specific types
//========================================================================
//------------------------------------------------------------------------
// Platform-specific joystick structure
//------------------------------------------------------------------------
typedef struct _GLFWjoystickLinux
{
int present;
int fd;
float* axes;
int axisCount;
unsigned char* buttons;
int buttonCount;
char* name;
} _GLFWjoystickLinux;
// Joystick input
//========================================================================
// Prototypes for platform specific internal functions
//========================================================================
void _glfwInitJoysticks(void);
void _glfwTerminateJoysticks(void);