Go to the documentation of this file.
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 },
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';
292 if (codepoint < 32 || (codepoint > 126 && codepoint < 160))
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))
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)
struct _GLFWwindow::@5 callbacks
#define GLFW_GAMEPAD_AXIS_LEFT_TRIGGER
struct _GLFWlibrary::@7 timer
#define GLFW_CURSOR_DISABLED
float _glfw_fmaxf(float a, float b)
#define GLFW_CURSOR_NORMAL
#define GLFW_KEY_KP_EQUAL
int _glfwPlatformCreateStandardCursor(_GLFWcursor *cursor, int shape)
#define _GLFW_POLL_BUTTONS
#define GLFW_CURSOR_HIDDEN
struct _GLFWlibrary::@9 callbacks
_GLFWmapelement buttons[15]
#define GLFW_ARROW_CURSOR
The regular arrow cursor shape.
int _glfwPlatformWindowFocused(_GLFWwindow *window)
char keys[GLFW_KEY_LAST+1]
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
struct GLFWwindow GLFWwindow
Opaque window object.
#define _GLFW_POLL_PRESENCE
uint64_t _glfwPlatformGetTimerFrequency(void)
int _glfwPlatformPollJoystick(_GLFWjoystick *js, int mode)
struct _GLFWlibrary::@6 hints
#define GLFW_GAMEPAD_AXIS_RIGHT_X
void _glfwInputError(int code, const char *format,...)
#define GLFW_MOD_CAPS_LOCK
If this bit is set the Caps Lock key is enabled.
#define GLFW_STICKY_MOUSE_BUTTONS
#define _GLFW_PLATFORM_MAPPING_NAME
#define GLFW_GAMEPAD_AXIS_LEFT_X
#define GLFW_IBEAM_CURSOR
The text input I-beam cursor shape.
int _glfwPlatformCreateCursor(_GLFWcursor *cursor, const GLFWimage *image, int xhot, int yhot)
#define GLFW_HAND_CURSOR
The hand shape.
#define GLFW_CROSSHAIR_CURSOR
The crosshair shape.
_GLFWjoystick joysticks[GLFW_JOYSTICK_LAST+1]
const char * _glfwPlatformGetScancodeName(int scancode)
GLFWmousebuttonfun mouseButton
GLenum GLuint GLenum GLsizei length
#define GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER
void _glfwPlatformSetCursor(_GLFWwindow *window, _GLFWcursor *cursor)
unsigned char buttons[15]
void _glfwPlatformUpdateGamepadGUID(char *guid)
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
void _glfwPlatformSetClipboardString(const char *string)
void _glfwPlatformSetCursorMode(_GLFWwindow *window, int mode)
#define _GLFW_REQUIRE_INIT()
char * _glfw_strdup(const char *source)
GLFWcursorenterfun cursorEnter
#define GLFW_VRESIZE_CURSOR
The vertical resize arrow shape.
GLFWcursorposfun cursorPos
#define _GLFW_SWAP_POINTERS(x, y)
struct _GLFWwindow * next
void _glfwPlatformSetCursorPos(_GLFWwindow *window, double xpos, double ypos)
GLFWbool stickyMouseButtons
const char * _glfwPlatformGetClipboardString(void)
void _glfwPlatformGetCursorPos(_GLFWwindow *window, double *xpos, double *ypos)
#define GLFW_GAMEPAD_AXIS_RIGHT_Y
#define GLFW_HRESIZE_CURSOR
The horizontal resize arrow shape.
#define GLFW_JOYSTICK_LAST
int _glfwPlatformGetKeyScancode(int key)
float _glfw_fminf(float a, float b)
char mouseButtons[GLFW_MOUSE_BUTTON_LAST+1]
#define GLFW_INVALID_ENUM
One of the arguments to the function was an invalid enum value.
#define GLFW_MOD_NUM_LOCK
If this bit is set the Num Lock key is enabled.
uint64_t _glfwPlatformGetTimerValue(void)
_GLFWwindow * windowListHead
_GLFWcursor * cursorListHead
void _glfwPlatformDestroyCursor(_GLFWcursor *cursor)
#define GLFW_GAMEPAD_AXIS_LAST
#define GLFW_GAMEPAD_AXIS_LEFT_Y
#define GLFW_LOCK_KEY_MODS
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:08