mirror of
https://github.com/glfw/glfw.git
synced 2026-09-21 00:30:57 +00:00
Move internals to shared joystick objects
Preparation for gamecontrollerdb support and the gamepad API.
This commit is contained in:
+5
-13
@@ -29,40 +29,32 @@
|
||||
|
||||
#include <regex.h>
|
||||
|
||||
#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE _GLFWjoylistLinux linux_js
|
||||
#define _GLFW_PLATFORM_JOYSTICK_STATE _GLFWjoystickLinux linjs
|
||||
#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE _GLFWlibraryLinux linjs
|
||||
|
||||
|
||||
// Linux-specific joystick data
|
||||
//
|
||||
typedef struct _GLFWjoystickLinux
|
||||
{
|
||||
GLFWbool present;
|
||||
int fd;
|
||||
float* axes;
|
||||
int axisCount;
|
||||
unsigned char* buttons;
|
||||
int buttonCount;
|
||||
char* name;
|
||||
char* path;
|
||||
} _GLFWjoystickLinux;
|
||||
|
||||
// Linux-specific joystick API data
|
||||
//
|
||||
typedef struct _GLFWjoylistLinux
|
||||
typedef struct _GLFWlibraryLinux
|
||||
{
|
||||
_GLFWjoystickLinux js[GLFW_JOYSTICK_LAST + 1];
|
||||
|
||||
#if defined(__linux__)
|
||||
int inotify;
|
||||
int watch;
|
||||
regex_t regex;
|
||||
#endif /*__linux__*/
|
||||
} _GLFWjoylistLinux;
|
||||
} _GLFWlibraryLinux;
|
||||
|
||||
|
||||
GLFWbool _glfwInitJoysticksLinux(void);
|
||||
void _glfwTerminateJoysticksLinux(void);
|
||||
|
||||
void _glfwPollJoystickEvents(void);
|
||||
void _glfwDetectJoystickConnectionLinux(void);
|
||||
|
||||
#endif // _glfw3_linux_joystick_h_
|
||||
|
||||
Reference in New Issue
Block a user