Commit 12b6c569 authored by Camilla Berglund's avatar Camilla Berglund
Browse files

Add suffixes to platform specific helper functions

Also merge win32_tls.h into win32_platform.h.
parent 0a3b5952
......@@ -17,8 +17,7 @@ if (_GLFW_COCOA)
set(glfw_SOURCES ${common_SOURCES} cocoa_init.m cocoa_monitor.m
cocoa_window.m iokit_joystick.m mach_time.c posix_tls.c)
elseif (_GLFW_WIN32)
set(glfw_HEADERS ${common_HEADERS} win32_platform.h win32_tls.h
winmm_joystick.h)
set(glfw_HEADERS ${common_HEADERS} win32_platform.h winmm_joystick.h)
set(glfw_SOURCES ${common_SOURCES} win32_init.c win32_monitor.c win32_time.c
win32_tls.c win32_window.c winmm_joystick.c)
elseif (_GLFW_X11)
......
......@@ -232,11 +232,14 @@ int _glfwPlatformInit(void)
if (!_glfw.ns.unicodeData)
return GLFW_FALSE;
if (!_glfwInitContextAPI())
if (!_glfwInitThreadLocalStoragePOSIX())
return GLFW_FALSE;
_glfwInitTimer();
_glfwInitJoysticks();
if (!_glfwInitNSGL())
return GLFW_FALSE;
_glfwInitTimerNS();
_glfwInitJoysticksNS();
return GLFW_TRUE;
}
......@@ -270,8 +273,9 @@ void _glfwPlatformTerminate(void)
free(_glfw.ns.clipboardString);
_glfwTerminateJoysticks();
_glfwTerminateContextAPI();
_glfwTerminateNSGL();
_glfwTerminateJoysticksNS();
_glfwTerminateThreadLocalStoragePOSIX();
}
const char* _glfwPlatformGetVersionString(void)
......
......@@ -166,7 +166,7 @@ static void endFadeReservation(CGDisplayFadeReservationToken token)
// Change the current video mode
//
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
GLFWbool _glfwSetVideoModeNS(_GLFWmonitor* monitor, const GLFWvidmode* desired)
{
CFArrayRef modes;
CFIndex count, i;
......@@ -224,7 +224,7 @@ GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired)
// Restore the previously saved (original) video mode
//
void _glfwRestoreVideoMode(_GLFWmonitor* monitor)
void _glfwRestoreVideoModeNS(_GLFWmonitor* monitor)
{
if (monitor->ns.previousMode)
{
......
......@@ -120,9 +120,9 @@ typedef struct _GLFWtimeNS
} _GLFWtimeNS;
void _glfwInitTimer(void);
void _glfwInitTimerNS(void);
GLFWbool _glfwSetVideoMode(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoMode(_GLFWmonitor* monitor);
GLFWbool _glfwSetVideoModeNS(_GLFWmonitor* monitor, const GLFWvidmode* desired);
void _glfwRestoreVideoModeNS(_GLFWmonitor* monitor);
#endif // _glfw3_cocoa_platform_h_
......@@ -76,7 +76,7 @@ static float transformY(float y)
//
static GLFWbool enterFullscreenMode(_GLFWwindow* window)
{
const GLFWbool status = _glfwSetVideoMode(window->monitor, &window->videoMode);
const GLFWbool status = _glfwSetVideoModeNS(window->monitor, &window->videoMode);
const CGRect bounds = CGDisplayBounds(window->monitor->ns.displayID);
const NSRect frame = NSMakeRect(bounds.origin.x,
transformY(bounds.origin.y + bounds.size.height),
......@@ -91,7 +91,7 @@ static GLFWbool enterFullscreenMode(_GLFWwindow* window)
//
static void leaveFullscreenMode(_GLFWwindow* window)
{
_glfwRestoreVideoMode(window->monitor);
_glfwRestoreVideoModeNS(window->monitor);
}
// Translates OS X key modifiers into GLFW ones
......@@ -262,7 +262,7 @@ static int translateKey(unsigned int key)
int i;
for (i = 0; i < _glfw.monitorCount; i++)
_glfwRestoreVideoMode(_glfw.monitors[i]);
_glfwRestoreVideoModeNS(_glfw.monitors[i]);
}
@end
......@@ -886,7 +886,7 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window,
if (ctxconfig->api != GLFW_NO_API)
{
if (!_glfwCreateContext(window, ctxconfig, fbconfig))
if (!_glfwCreateContextNSGL(window, ctxconfig, fbconfig))
return GLFW_FALSE;
}
......@@ -908,7 +908,7 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
leaveFullscreenMode(window);
if (window->context.api != GLFW_NO_API)
_glfwDestroyContext(window);
_glfwDestroyContextNSGL(window);
[window->ns.object setDelegate:nil];
[window->ns.delegate release];
......
......@@ -176,7 +176,7 @@ static GLFWbool chooseFBConfigs(const _GLFWctxconfig* ctxconfig,
// Initialize EGL
//
int _glfwInitContextAPI(void)
int _glfwInitEGL(void)
{
int i;
const char* sonames[] =
......@@ -192,9 +192,6 @@ int _glfwInitContextAPI(void)
NULL
};
if (!_glfwCreateContextTLS())
return GLFW_FALSE;
for (i = 0; sonames[i]; i++)
{
_glfw.egl.handle = _glfw_dlopen(sonames[i]);
......@@ -268,7 +265,7 @@ int _glfwInitContextAPI(void)
// Terminate EGL
//
void _glfwTerminateContextAPI(void)
void _glfwTerminateEGL(void)
{
if (_glfw.egl.handle)
{
......@@ -276,8 +273,6 @@ void _glfwTerminateContextAPI(void)
_glfw_dlclose(_glfw.egl.handle);
_glfw.egl.handle = NULL;
}
_glfwDestroyContextTLS();
}
#define setEGLattrib(attribName, attribValue) \
......@@ -289,9 +284,9 @@ void _glfwTerminateContextAPI(void)
// Create the OpenGL or OpenGL ES context
//
int _glfwCreateContext(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig)
int _glfwCreateContextEGL(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig)
{
int attribs[40];
EGLConfig config;
......@@ -492,7 +487,7 @@ int _glfwCreateContext(_GLFWwindow* window,
// Destroy the OpenGL context
//
void _glfwDestroyContext(_GLFWwindow* window)
void _glfwDestroyContextEGL(_GLFWwindow* window)
{
#if defined(_GLFW_X11)
// NOTE: Do not unload libGL.so.1 while the X11 display is still open,
......@@ -523,9 +518,9 @@ void _glfwDestroyContext(_GLFWwindow* window)
// Returns the Visual and depth of the chosen EGLConfig
//
#if defined(_GLFW_X11)
GLFWbool _glfwChooseVisual(const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig,
Visual** visual, int* depth)
GLFWbool _glfwChooseVisualEGL(const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig,
Visual** visual, int* depth)
{
XVisualInfo* result;
XVisualInfo desired;
......@@ -584,7 +579,7 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
EGL_NO_CONTEXT);
}
_glfwSetContextTLS(window);
_glfwPlatformSetCurrentContext(window);
}
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
......
......@@ -207,16 +207,16 @@ typedef struct _GLFWlibraryEGL
} _GLFWlibraryEGL;
int _glfwInitContextAPI(void);
void _glfwTerminateContextAPI(void);
int _glfwCreateContext(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig);
void _glfwDestroyContext(_GLFWwindow* window);
int _glfwInitEGL(void);
void _glfwTerminateEGL(void);
int _glfwCreateContextEGL(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig);
void _glfwDestroyContextEGL(_GLFWwindow* window);
#if defined(_GLFW_X11)
GLFWbool _glfwChooseVisual(const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig,
Visual** visual, int* depth);
GLFWbool _glfwChooseVisualEGL(const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig,
Visual** visual, int* depth);
#endif /*_GLFW_X11*/
#endif // _glfw3_egl_context_h_
......@@ -150,7 +150,7 @@ static GLXContext createLegacyContext(_GLFWwindow* window,
// Initialize GLX
//
int _glfwInitContextAPI(void)
int _glfwInitGLX(void)
{
int i;
const char* sonames[] =
......@@ -165,9 +165,6 @@ int _glfwInitContextAPI(void)
};
if (!_glfwCreateContextTLS())
return GLFW_FALSE;
for (i = 0; sonames[i]; i++)
{
_glfw.glx.handle = dlopen(sonames[i], RTLD_LAZY | RTLD_GLOBAL);
......@@ -296,7 +293,7 @@ int _glfwInitContextAPI(void)
// Terminate GLX
//
void _glfwTerminateContextAPI(void)
void _glfwTerminateGLX(void)
{
// NOTE: This function must not call any X11 functions, as it is called
// after XCloseDisplay (see _glfwPlatformTerminate for details)
......@@ -306,8 +303,6 @@ void _glfwTerminateContextAPI(void)
dlclose(_glfw.glx.handle);
_glfw.glx.handle = NULL;
}
_glfwDestroyContextTLS();
}
#define setGLXattrib(attribName, attribValue) \
......@@ -319,9 +314,9 @@ void _glfwTerminateContextAPI(void)
// Create the OpenGL or OpenGL ES context
//
int _glfwCreateContext(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig)
int _glfwCreateContextGLX(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig)
{
int attribs[40];
GLXFBConfig native = NULL;
......@@ -370,7 +365,7 @@ int _glfwCreateContext(_GLFWwindow* window,
}
}
_glfwGrabXErrorHandler();
_glfwGrabErrorHandlerX11();
if (_glfw.glx.ARB_create_context)
{
......@@ -473,11 +468,11 @@ int _glfwCreateContext(_GLFWwindow* window,
else
window->context.glx.handle = createLegacyContext(window, native, share);
_glfwReleaseXErrorHandler();
_glfwReleaseErrorHandlerX11();
if (!window->context.glx.handle)
{
_glfwInputXError(GLFW_VERSION_UNAVAILABLE, "GLX: Failed to create context");
_glfwInputErrorX11(GLFW_VERSION_UNAVAILABLE, "GLX: Failed to create context");
return GLFW_FALSE;
}
......@@ -496,7 +491,7 @@ int _glfwCreateContext(_GLFWwindow* window,
// Destroy the OpenGL context
//
void _glfwDestroyContext(_GLFWwindow* window)
void _glfwDestroyContextGLX(_GLFWwindow* window)
{
if (window->context.glx.window)
{
......@@ -513,9 +508,9 @@ void _glfwDestroyContext(_GLFWwindow* window)
// Returns the Visual and depth of the chosen GLXFBConfig
//
GLFWbool _glfwChooseVisual(const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig,
Visual** visual, int* depth)
GLFWbool _glfwChooseVisualGLX(const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig,
Visual** visual, int* depth)
{
GLXFBConfig native;
XVisualInfo* result;
......@@ -558,7 +553,7 @@ void _glfwPlatformMakeContextCurrent(_GLFWwindow* window)
else
glXMakeCurrent(_glfw.x11.display, None, NULL);
_glfwSetContextTLS(window);
_glfwPlatformSetCurrentContext(window);
}
void _glfwPlatformSwapBuffers(_GLFWwindow* window)
......
......@@ -171,14 +171,14 @@ typedef struct _GLFWlibraryGLX
} _GLFWlibraryGLX;
int _glfwInitContextAPI(void);
void _glfwTerminateContextAPI(void);
int _glfwCreateContext(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig);
void _glfwDestroyContext(_GLFWwindow* window);
GLFWbool _glfwChooseVisual(const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig,
Visual** visual, int* depth);
int _glfwInitGLX(void);
void _glfwTerminateGLX(void);
int _glfwCreateContextGLX(_GLFWwindow* window,
const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig);
void _glfwDestroyContextGLX(_GLFWwindow* window);
GLFWbool _glfwChooseVisualGLX(const _GLFWctxconfig* ctxconfig,
const _GLFWfbconfig* fbconfig,
Visual** visual, int* depth);
#endif // _glfw3_glx_context_h_
......@@ -637,6 +637,10 @@ void _glfwPlatformPostEmptyEvent(void);
*/
void _glfwPlatformMakeContextCurrent(_GLFWwindow* window);
/*! @ingroup platform
*/
void _glfwPlatformSetCurrentContext(_GLFWwindow* context);
/*! @copydoc glfwGetCurrentContext
* @ingroup platform
*/
......
//========================================================================
// GLFW 3.2 IOKit - www.glfw.org
// GLFW 3.2 Cocoa - www.glfw.org
//------------------------------------------------------------------------
// Copyright (c) 2006-2014 Camilla Berglund <elmindreda@elmindreda.org>
//
......@@ -32,13 +32,12 @@
#include <IOKit/hid/IOHIDLib.h>
#include <IOKit/hid/IOHIDKeys.h>
#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \
_GLFWjoystickIOKit iokit_js
#define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE _GLFWjoystickNS ns_js
// IOKit-specific per-joystick data
//
typedef struct _GLFWjoydevice
typedef struct _GLFWjoydeviceNS
{
int present;
char name[256];
......@@ -51,18 +50,18 @@ typedef struct _GLFWjoydevice
float* axes;
unsigned char* buttons;
} _GLFWjoydevice;
} _GLFWjoydeviceNS;
// IOKit-specific joystick API data
//
typedef struct _GLFWjoystickIOKit
typedef struct _GLFWjoystickNS
{
_GLFWjoydevice devices[GLFW_JOYSTICK_LAST + 1];
_GLFWjoydeviceNS devices[GLFW_JOYSTICK_LAST + 1];
IOHIDManagerRef managerRef;
} _GLFWjoystickIOKit;
} _GLFWjoystickNS;
void _glfwInitJoysticks(void);
void _glfwTerminateJoysticks(void);
void _glfwInitJoysticksNS(void);
void _glfwTerminateJoysticksNS(void);
#endif // _glfw3_iokit_joystick_h_
//========================================================================
// GLFW 3.2 IOKit - www.glfw.org
// GLFW 3.2 Cocoa - www.glfw.org
//------------------------------------------------------------------------
// Copyright (c) 2009-2010 Camilla Berglund <elmindreda@elmindreda.org>
// Copyright (c) 2012 Torsten Walluhn <tw@mad-cad.net>
......@@ -40,7 +40,7 @@
//------------------------------------------------------------------------
// Joystick element information
//------------------------------------------------------------------------
typedef struct
typedef struct _GLFWjoyelementNS
{
IOHIDElementRef elementRef;
......@@ -50,14 +50,14 @@ typedef struct
long minReport;
long maxReport;
} _GLFWjoyelement;
} _GLFWjoyelementNS;
static void getElementsCFArrayHandler(const void* value, void* parameter);
// Adds an element to the specified joystick
//
static void addJoystickElement(_GLFWjoydevice* joystick,
static void addJoystickElement(_GLFWjoydeviceNS* joystick,
IOHIDElementRef elementRef)
{
IOHIDElementType elementType;
......@@ -109,7 +109,7 @@ static void addJoystickElement(_GLFWjoydevice* joystick,
if (elementsArray)
{
_GLFWjoyelement* element = calloc(1, sizeof(_GLFWjoyelement));
_GLFWjoyelementNS* element = calloc(1, sizeof(_GLFWjoyelementNS));
CFArrayAppendValue(elementsArray, element);
......@@ -126,14 +126,14 @@ static void getElementsCFArrayHandler(const void* value, void* parameter)
{
if (CFGetTypeID(value) == IOHIDElementGetTypeID())
{
addJoystickElement((_GLFWjoydevice*) parameter,
addJoystickElement((_GLFWjoydeviceNS*) parameter,
(IOHIDElementRef) value);
}
}
// Returns the value of the specified element of the specified joystick
//
static long getElementValue(_GLFWjoydevice* joystick, _GLFWjoyelement* element)
static long getElementValue(_GLFWjoydeviceNS* joystick, _GLFWjoyelementNS* element)
{
IOReturn result = kIOReturnSuccess;
IOHIDValueRef valueRef;
......@@ -163,7 +163,7 @@ static long getElementValue(_GLFWjoydevice* joystick, _GLFWjoyelement* element)
// Removes the specified joystick
//
static void removeJoystick(_GLFWjoydevice* joystick)
static void removeJoystick(_GLFWjoydeviceNS* joystick)
{
int i;
......@@ -188,7 +188,7 @@ static void removeJoystick(_GLFWjoydevice* joystick)
free(joystick->axes);
free(joystick->buttons);
memset(joystick, 0, sizeof(_GLFWjoydevice));
memset(joystick, 0, sizeof(_GLFWjoydeviceNS));
}
// Polls for joystick events and updates GLFW state
......@@ -201,14 +201,14 @@ static void pollJoystickEvents(void)
{
CFIndex i;
int buttonIndex = 0;
_GLFWjoydevice* joystick = _glfw.iokit_js.devices + joy;
_GLFWjoydeviceNS* joystick = _glfw.ns_js.devices + joy;
if (!joystick->present)
continue;
for (i = 0; i < CFArrayGetCount(joystick->buttonElements); i++)
{
_GLFWjoyelement* button = (_GLFWjoyelement*)
_GLFWjoyelementNS* button = (_GLFWjoyelementNS*)
CFArrayGetValueAtIndex(joystick->buttonElements, i);
if (getElementValue(joystick, button))
......@@ -219,7 +219,7 @@ static void pollJoystickEvents(void)
for (i = 0; i < CFArrayGetCount(joystick->axisElements); i++)
{
_GLFWjoyelement* axis = (_GLFWjoyelement*)
_GLFWjoyelementNS* axis = (_GLFWjoyelementNS*)
CFArrayGetValueAtIndex(joystick->axisElements, i);
long value = getElementValue(joystick, axis);
......@@ -233,7 +233,7 @@ static void pollJoystickEvents(void)
for (i = 0; i < CFArrayGetCount(joystick->hatElements); i++)
{
_GLFWjoyelement* hat = (_GLFWjoyelement*)
_GLFWjoyelementNS* hat = (_GLFWjoyelementNS*)
CFArrayGetValueAtIndex(joystick->hatElements, i);
// Bit fields of button presses for each direction, including nil
......@@ -261,12 +261,12 @@ static void matchCallback(void* context,
void* sender,
IOHIDDeviceRef deviceRef)
{
_GLFWjoydevice* joystick;
_GLFWjoydeviceNS* joystick;
int joy;
for (joy = GLFW_JOYSTICK_1; joy <= GLFW_JOYSTICK_LAST; joy++)
{
joystick = _glfw.iokit_js.devices + joy;
joystick = _glfw.ns_js.devices + joy;
if (!joystick->present)
continue;
......@@ -277,7 +277,7 @@ static void matchCallback(void* context,
for (joy = GLFW_JOYSTICK_1; joy <= GLFW_JOYSTICK_LAST; joy++)
{
joystick = _glfw.iokit_js.devices + joy;
joystick = _glfw.ns_js.devices + joy;
if (!joystick->present)
break;
......@@ -328,7 +328,7 @@ static void removeCallback(void* context,
for (joy = GLFW_JOYSTICK_1; joy <= GLFW_JOYSTICK_LAST; joy++)
{
_GLFWjoydevice* joystick = _glfw.iokit_js.devices + joy;
_GLFWjoydeviceNS* joystick = _glfw.ns_js.devices + joy;
if (joystick->deviceRef == deviceRef)
{
removeJoystick(joystick);
......@@ -384,12 +384,12 @@ static CFMutableDictionaryRef createMatchingDictionary(long usagePage,
// Initialize joystick interface
//
void _glfwInitJoysticks(void)
void _glfwInitJoysticksNS(void)
{
CFMutableArrayRef matchingCFArrayRef;
_glfw.iokit_js.managerRef = IOHIDManagerCreate(kCFAllocatorDefault,
kIOHIDOptionsTypeNone);
_glfw.ns_js.managerRef = IOHIDManagerCreate(kCFAllocatorDefault,
kIOHIDOptionsTypeNone);
matchingCFArrayRef = CFArrayCreateMutable(kCFAllocatorDefault,
0,
......@@ -422,21 +422,21 @@ void _glfwInitJoysticks(void)
CFRelease(matchingCFDictRef);
}
IOHIDManagerSetDeviceMatchingMultiple(_glfw.iokit_js.managerRef,
IOHIDManagerSetDeviceMatchingMultiple(_glfw.ns_js.managerRef,
matchingCFArrayRef);
CFRelease(matchingCFArrayRef);
}
IOHIDManagerRegisterDeviceMatchingCallback(_glfw.iokit_js.managerRef,
IOHIDManagerRegisterDeviceMatchingCallback(_glfw.ns_js.managerRef,
&matchCallback, NULL);
IOHIDManagerRegisterDeviceRemovalCallback(_glfw.iokit_js.managerRef,
IOHIDManagerRegisterDeviceRemovalCallback(_glfw.ns_js.managerRef,
&removeCallback, NULL);
IOHIDManagerScheduleWithRunLoop(_glfw.iokit_js.managerRef,
IOHIDManagerScheduleWithRunLoop(_glfw.ns_js.managerRef,
CFRunLoopGetMain(),
kCFRunLoopDefaultMode);
IOHIDManagerOpen(_glfw.iokit_js.managerRef, kIOHIDOptionsTypeNone);
IOHIDManagerOpen(_glfw.ns_js.managerRef, kIOHIDOptionsTypeNone);
// Execute the run loop once in order to register any initially-attached
// joysticks
......@@ -445,18 +445,18 @@ void _glfwInitJoysticks(void)
// Close all opened joystick handles
//
void _glfwTerminateJoysticks(void)
void _glfwTerminateJoysticksNS(void)
{
int joy;
for (joy = 0; joy <= GLFW_JOYSTICK_LAST; joy++)
{
_GLFWjoydevice* joystick = _glfw.iokit_js.devices + joy;
_GLFWjoydeviceNS* joystick = _glfw.ns_js.devices + joy;
removeJoystick(joystick);
}
CFRelease(_glfw.iokit_js.managerRef);
_glfw.iokit_js.managerRef = NULL;
CFRelease(_glfw.ns_js.managerRef);
_glfw.ns_js.managerRef = NULL;
}
......@@ -468,12 +468,12 @@ int _glfwPlatformJoystickPresent(int joy)
{
pollJoystickEvents();
return _glfw.iokit_js.devices[joy].present;
return _glfw.ns_js.devices[joy].present;
}
const float* _glfwPlatformGetJoystickAxes(int joy, int* count)
{
_GLFWjoydevice* joystick = _glfw.iokit_js.devices + joy;
_GLFWjoydeviceNS* joystick = _glfw.ns_js.devices + joy;
pollJoystickEvents();
......@@ -486,7 +486,7 @@ const float* _glfwPlatformGetJoystickAxes(int joy, int* count)
const unsigned char* _glfwPlatformGetJoystickButtons(int joy, int* count)
{
_GLFWjoydevice* joystick = _glfw.iokit_js.devices + joy;
_GLFWjoydeviceNS* joystick = _glfw.ns_js.devices + joy;
pollJoystickEvents();
......@@ -502,6 +502,6 @@ const char* _glfwPlatformGetJoystickName(int joy)
{
pollJoystickEvents();
return _glfw.iokit_js.devices[joy].name;
return _glfw.ns_js.devices[joy].name;
}
......@@ -173,7 +173,7 @@ static GLFWbool pollJoystickEvents(_GLFWjoystickLinux* js)
// Initialize joystick interface
//
int _glfwInitJoysticks(void)
int _glfwInitJoysticksLinux(void)
{
#if defined(__linux__)