mirror of
https://github.com/glfw/glfw.git
synced 2026-09-18 22:55:46 +00:00
Initial implementation of joystick name retrieval on Win32.
This commit is contained in:
+12
-1
@@ -225,6 +225,17 @@ int _glfwPlatformGetJoystickButtons(int joy, unsigned char* buttons,
|
||||
|
||||
const char* _glfwPlatformGetJoystickName(int joy)
|
||||
{
|
||||
return "";
|
||||
JOYCAPS jc;
|
||||
const int i = joy - GLFW_JOYSTICK_1;
|
||||
|
||||
if (!isJoystickPresent(joy))
|
||||
return NULL;
|
||||
|
||||
_glfw_joyGetDevCaps(i, &jc, sizeof(JOYCAPS));
|
||||
|
||||
free(_glfwLibrary.Win32.joyNames[i]);
|
||||
_glfwLibrary.Win32.joyNames[i] = _glfwCreateUTF8FromWideString(jc.szPname);
|
||||
|
||||
return _glfwLibrary.Win32.joyNames[i];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user