Moved Cocoa joystick state to library struct.

This commit is contained in:
Camilla Berglund
2013-02-14 19:07:17 +01:00
parent 94f5b28152
commit ec8273f249
2 changed files with 61 additions and 62 deletions
+28
View File
@@ -46,6 +46,11 @@ 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>
#define _GLFW_PLATFORM_WINDOW_STATE _GLFWwindowNS ns
#define _GLFW_PLATFORM_LIBRARY_WINDOW_STATE _GLFWlibraryNS ns
#define _GLFW_PLATFORM_MONITOR_STATE _GLFWmonitorNS ns
@@ -73,6 +78,27 @@ typedef struct _GLFWwindowNS
} _GLFWwindowNS;
//------------------------------------------------------------------------
// Joystick information & state
//------------------------------------------------------------------------
typedef struct
{
int present;
char name[256];
IOHIDDeviceInterface** interface;
int numAxes;
int numButtons;
int numHats;
CFMutableArrayRef axes;
CFMutableArrayRef buttons;
CFMutableArrayRef hats;
} _GLFWjoy;
//------------------------------------------------------------------------
// Platform-specific library global data for Cocoa
//------------------------------------------------------------------------
@@ -88,6 +114,8 @@ typedef struct _GLFWlibraryNS
id autoreleasePool;
char* clipboardString;
_GLFWjoy joysticks[GLFW_JOYSTICK_LAST + 1];
} _GLFWlibraryNS;