40 #define _GLFW_JOYSTICK_AXIS 1 41 #define _GLFW_JOYSTICK_BUTTON 2 42 #define _GLFW_JOYSTICK_HATBIT 3 88 "Invalid button in gamepad mapping %s (%s)",
100 "Invalid axis in gamepad mapping %s (%s)",
115 const char* c = string;
123 {
"platform", NULL },
147 length = strcspn(c,
",");
148 if (length != 32 || c[length] !=
',')
154 memcpy(mapping->
guid, c, length);
157 length = strcspn(c,
",");
158 if (length >=
sizeof(mapping->
name) || c[length] !=
',')
164 memcpy(mapping->
name, c, length);
170 if (*c ==
'+' || *c ==
'-')
173 for (i = 0; i <
sizeof(fields) /
sizeof(fields[0]); i++)
175 length = strlen(fields[i].name);
176 if (strncmp(c, fields[i].name, length) != 0 || c[length] !=
':')
181 if (fields[i].element)
209 const unsigned long hat = strtoul(c + 1, (
char**) &c, 10);
210 const unsigned long bit = strtoul(c + 1, (
char**) &c, 10);
211 e->
index = (uint8_t) ((hat << 4) | bit);
214 e->
index = (uint8_t) strtoul(c + 1, (
char**) &c, 10);
238 c += strcspn(c,
",");
242 for (i = 0; i < 32; i++)
244 if (mapping->
guid[i] >=
'A' && mapping->
guid[i] <=
'F')
245 mapping->
guid[i] +=
'a' -
'A';
274 window->
keys[key] = (char) action;
292 if (codepoint < 32 || (codepoint > 126 && codepoint < 160))
303 if (window->callbacks.character)
304 window->callbacks.character((
GLFWwindow*) window, codepoint);
380 js->
axes[axis] = value;
401 js->
hats[hat] = value;
432 js->
axes = calloc(axisCount,
sizeof(
float));
433 js->
buttons = calloc(buttonCount + hatCount * 4, 1);
434 js->
hats = calloc(hatCount, 1);
439 strcpy(js->
guid, guid);
464 assert(window != NULL);
487 assert(window != NULL);
498 "Invalid cursor mode 0x%08X",
594 assert(window != NULL);
611 return (
int) window->
keys[key];
617 assert(window != NULL);
640 assert(window != NULL);
663 assert(window != NULL);
667 if (xpos != xpos || xpos < -DBL_MAX || xpos > DBL_MAX ||
668 ypos != ypos || ypos < -DBL_MAX || ypos > DBL_MAX)
671 "Invalid cursor position %f %f",
696 assert(image != NULL);
758 if (window->
cursor == cursor)
769 while (*prev != cursor)
770 prev = &((*prev)->next);
772 *prev = cursor->
next;
782 assert(window != NULL);
794 assert(window != NULL);
804 assert(window != NULL);
814 assert(window != NULL);
825 assert(window != NULL);
836 assert(window != NULL);
847 assert(window != NULL);
858 assert(window != NULL);
868 assert(window != NULL);
903 assert(count != NULL);
932 assert(count != NULL);
965 assert(count != NULL);
1080 const char* c = string;
1082 assert(
string != NULL);
1088 if ((*c >=
'0' && *c <=
'9') ||
1089 (*c >=
'a' && *c <=
'f') ||
1090 (*c >=
'A' && *c <=
'F'))
1094 const size_t length = strcspn(c,
"\r\n");
1095 if (length <
sizeof(line))
1099 memcpy(line, c, length);
1106 *previous = mapping;
1122 c += strcspn(c,
"\r\n");
1123 c += strspn(c,
"\r\n");
1197 assert(state != NULL);
1230 const unsigned int hat = e->
index >> 4;
1231 const unsigned int bit = e->
index & 0xf;
1232 if (js->
hats[hat] & bit)
1249 const unsigned int hat = e->
index >> 4;
1250 const unsigned int bit = e->
index & 0xf;
1251 if (js->
hats[hat] & bit)
1252 state->
axes[i] = 1.f;
1263 assert(
string != NULL);
1286 if (time != time || time < 0.0 || time > 18446744073.0)
GLFWcursorposfun cursorPos
#define GLFW_GAMEPAD_AXIS_LEFT_Y
float _glfw_fminf(float a, float b)
#define _GLFW_REQUIRE_INIT()
struct _GLFWwindow::@5 callbacks
GLFWmousebuttonfun mouseButton
#define _GLFW_PLATFORM_MAPPING_NAME
#define _GLFW_POLL_PRESENCE
GLFWcursorenterfun cursorEnter
uint64_t _glfwPlatformGetTimerFrequency(void)
char * _glfw_strdup(const char *source)
#define GLFW_CROSSHAIR_CURSOR
The crosshair shape.
GLenum GLuint GLenum GLsizei length
void _glfwPlatformSetClipboardString(const char *string)
const char * _glfwPlatformGetClipboardString(void)
#define GLFW_ARROW_CURSOR
The regular arrow cursor shape.
_GLFWwindow * windowListHead
struct GLFWwindow GLFWwindow
Opaque window object.
#define GLFW_GAMEPAD_AXIS_RIGHT_X
#define GLFW_CURSOR_DISABLED
#define _GLFW_SWAP_POINTERS(x, y)
_GLFWcursor * cursorListHead
#define GLFW_VRESIZE_CURSOR
The vertical resize arrow shape.
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
char keys[GLFW_KEY_LAST+1]
struct _GLFWlibrary::@6 hints
#define GLFW_CURSOR_NORMAL
GLFWbool stickyMouseButtons
#define GLFW_HAND_CURSOR
The hand shape.
#define _GLFW_POLL_BUTTONS
#define GLFW_JOYSTICK_LAST
struct _GLFWwindow * next
unsigned char buttons[15]
#define GLFW_GAMEPAD_AXIS_LEFT_X
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double xpos, double ypos)
void _glfwInputError(int code, const char *format,...)
struct _GLFWlibrary::@7 timer
const char * _glfwPlatformGetScancodeName(int scancode)
#define GLFW_MOD_CAPS_LOCK
If this bit is set the Caps Lock key is enabled.
#define GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
uint64_t _glfwPlatformGetTimerValue(void)
#define GLFW_INVALID_ENUM
One of the arguments to the function was an invalid enum value.
int _glfwPlatformWindowFocused(_GLFWwindow *window)
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
int _glfwPlatformCreateCursor(_GLFWcursor *cursor, const GLFWimage *image, int xhot, int yhot)
#define GLFW_GAMEPAD_AXIS_LAST
#define GLFW_CURSOR_HIDDEN
void _glfwPlatformGetCursorPos(_GLFWwindow *window, double *xpos, double *ypos)
#define GLFW_HRESIZE_CURSOR
The horizontal resize arrow shape.
struct _GLFWlibrary::@9 callbacks
#define GLFW_IBEAM_CURSOR
The text input I-beam cursor shape.
_GLFWmapelement buttons[15]
float _glfw_fmaxf(float a, float b)
void _glfwPlatformSetCursorMode(_GLFWwindow *window, int mode)
#define GLFW_KEY_KP_EQUAL
int _glfwPlatformCreateStandardCursor(_GLFWcursor *cursor, int shape)
char mouseButtons[GLFW_MOUSE_BUTTON_LAST+1]
#define GLFW_LOCK_KEY_MODS
int _glfwPlatformPollJoystick(_GLFWjoystick *js, int mode)
_GLFWjoystick joysticks[GLFW_JOYSTICK_LAST+1]
#define GLFW_STICKY_MOUSE_BUTTONS
#define GLFW_GAMEPAD_AXIS_RIGHT_Y
void _glfwPlatformUpdateGamepadGUID(char *guid)
void _glfwPlatformSetCursor(_GLFWwindow *window, _GLFWcursor *cursor)
void _glfwPlatformDestroyCursor(_GLFWcursor *cursor)
#define GLFW_GAMEPAD_AXIS_LEFT_TRIGGER
#define GLFW_MOD_NUM_LOCK
If this bit is set the Num Lock key is enabled.
int _glfwPlatformGetKeyScancode(int key)