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
+1 -29
View File
@@ -45,10 +45,7 @@ typedef void* id;
#error "No supported context creation API selected"
#endif
#include <IOKit/IOKitLib.h>
#include <IOKit/IOCFPlugIn.h>
#include <IOKit/hid/IOHIDLib.h>
#include <IOKit/hid/IOHIDKeys.h>
#include "iokit_joystick.h"
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS ns
#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryNS ns
@@ -74,26 +71,6 @@ typedef struct _GLFWwindowNS
} _GLFWwindowNS;
//------------------------------------------------------------------------
// Joystick information & state
//------------------------------------------------------------------------
typedef struct
{
int present;
char name[256];
IOHIDDeviceInterface** interface;
CFMutableArrayRef axisElements;
CFMutableArrayRef buttonElements;
CFMutableArrayRef hatElements;
float* axes;
unsigned char* buttons;
} _GLFWjoy;
//------------------------------------------------------------------------
// Platform-specific library global data for Cocoa
//------------------------------------------------------------------------
@@ -111,7 +88,6 @@ typedef struct _GLFWlibraryNS
char* clipboardString;
_GLFWjoy joysticks[GLFW_JOYSTICK_LAST + 1];
} _GLFWlibraryNS;
@@ -143,10 +119,6 @@ typedef struct _GLFWcursorNS
// Time
void _glfwInitTimer(void);
// Joystick input
void _glfwInitJoysticks(void);
void _glfwTerminateJoysticks(void);
// Fullscreen
GLboolean _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);