• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //========================================================================
2 // GLFW 3.2 Win32 - www.glfw.org
3 //------------------------------------------------------------------------
4 // Copyright (c) 2006-2016 Camilla Berglund <elmindreda@glfw.org>
5 //
6 // This software is provided 'as-is', without any express or implied
7 // warranty. In no event will the authors be held liable for any damages
8 // arising from the use of this software.
9 //
10 // Permission is granted to anyone to use this software for any purpose,
11 // including commercial applications, and to alter it and redistribute it
12 // freely, subject to the following restrictions:
13 //
14 // 1. The origin of this software must not be misrepresented; you must not
15 //    claim that you wrote the original software. If you use this software
16 //    in a product, an acknowledgment in the product documentation would
17 //    be appreciated but is not required.
18 //
19 // 2. Altered source versions must be plainly marked as such, and must not
20 //    be misrepresented as being the original software.
21 //
22 // 3. This notice may not be removed or altered from any source
23 //    distribution.
24 //
25 //========================================================================
26 
27 #ifndef _glfw3_win32_joystick_h_
28 #define _glfw3_win32_joystick_h_
29 
30 #define _GLFW_PLATFORM_LIBRARY_JOYSTICK_STATE \
31     _GLFWjoystickWin32 win32_js[GLFW_JOYSTICK_LAST + 1]
32 
33 // Joystick element (axis, button or slider)
34 //
35 typedef struct _GLFWjoyobjectWin32
36 {
37     int                     offset;
38     int                     type;
39 } _GLFWjoyobjectWin32;
40 
41 // Win32-specific per-joystick data
42 //
43 typedef struct _GLFWjoystickWin32
44 {
45     GLFWbool                present;
46     float*                  axes;
47     int                     axisCount;
48     unsigned char*          buttons;
49     int                     buttonCount;
50     _GLFWjoyobjectWin32*    objects;
51     int                     objectCount;
52     char*                   name;
53     IDirectInputDevice8W*   device;
54     DWORD                   index;
55     GUID                    guid;
56 } _GLFWjoystickWin32;
57 
58 
59 void _glfwInitJoysticksWin32(void);
60 void _glfwTerminateJoysticksWin32(void);
61 void _glfwDetectJoystickConnectionWin32(void);
62 void _glfwDetectJoystickDisconnectionWin32(void);
63 
64 #endif // _glfw3_win32_joystick_h_
65