mirror of
https://github.com/glfw/glfw.git
synced 2026-11-18 21:04:54 +00:00
Moved Cocoa joystick state to library struct.
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user