Lines Matching full:js
54 _GLFWjoystickLinux* js; in openJoystickDevice() local
58 if (!_glfw.linux_js.js[joy].present) in openJoystickDevice()
61 if (strcmp(_glfw.linux_js.js[joy].path, path) == 0) in openJoystickDevice()
67 if (!_glfw.linux_js.js[joy].present) in openJoystickDevice()
90 js = _glfw.linux_js.js + joy; in openJoystickDevice()
91 js->present = GLFW_TRUE; in openJoystickDevice()
92 js->name = strdup(name); in openJoystickDevice()
93 js->path = strdup(path); in openJoystickDevice()
94 js->fd = fd; in openJoystickDevice()
97 js->axisCount = (int) axisCount; in openJoystickDevice()
98 js->axes = calloc(axisCount, sizeof(float)); in openJoystickDevice()
101 js->buttonCount = (int) buttonCount; in openJoystickDevice()
102 js->buttons = calloc(buttonCount, 1); in openJoystickDevice()
111 static GLFWbool pollJoystickEvents(_GLFWjoystickLinux* js) in pollJoystickEvents() argument
116 if (!js->present) in pollJoystickEvents()
125 if (read(js->fd, &e, sizeof(e)) < 0) in pollJoystickEvents()
130 free(js->axes); in pollJoystickEvents()
131 free(js->buttons); in pollJoystickEvents()
132 free(js->name); in pollJoystickEvents()
133 free(js->path); in pollJoystickEvents()
135 memset(js, 0, sizeof(_GLFWjoystickLinux)); in pollJoystickEvents()
137 _glfwInputJoystickChange(js - _glfw.linux_js.js, in pollJoystickEvents()
148 js->axes[e.number] = (float) e.value / 32767.0f; in pollJoystickEvents()
150 js->buttons[e.number] = e.value ? GLFW_PRESS : GLFW_RELEASE; in pollJoystickEvents()
153 return js->present; in pollJoystickEvents()
205 if (regcomp(&_glfw.linux_js.regex, "^js[0-9]\\+$", 0) != 0) in _glfwInitJoysticksLinux()
240 qsort(_glfw.linux_js.js, count, sizeof(_GLFWjoystickLinux), compareJoysticks); in _glfwInitJoysticksLinux()
255 if (_glfw.linux_js.js[i].present) in _glfwTerminateJoysticksLinux()
257 close(_glfw.linux_js.js[i].fd); in _glfwTerminateJoysticksLinux()
258 free(_glfw.linux_js.js[i].axes); in _glfwTerminateJoysticksLinux()
259 free(_glfw.linux_js.js[i].buttons); in _glfwTerminateJoysticksLinux()
260 free(_glfw.linux_js.js[i].name); in _glfwTerminateJoysticksLinux()
261 free(_glfw.linux_js.js[i].path); in _glfwTerminateJoysticksLinux()
309 _GLFWjoystickLinux* js = _glfw.linux_js.js + joy; in _glfwPlatformJoystickPresent() local
310 return pollJoystickEvents(js); in _glfwPlatformJoystickPresent()
315 _GLFWjoystickLinux* js = _glfw.linux_js.js + joy; in _glfwPlatformGetJoystickAxes() local
316 if (!pollJoystickEvents(js)) in _glfwPlatformGetJoystickAxes()
319 *count = js->axisCount; in _glfwPlatformGetJoystickAxes()
320 return js->axes; in _glfwPlatformGetJoystickAxes()
325 _GLFWjoystickLinux* js = _glfw.linux_js.js + joy; in _glfwPlatformGetJoystickButtons() local
326 if (!pollJoystickEvents(js)) in _glfwPlatformGetJoystickButtons()
329 *count = js->buttonCount; in _glfwPlatformGetJoystickButtons()
330 return js->buttons; in _glfwPlatformGetJoystickButtons()
335 _GLFWjoystickLinux* js = _glfw.linux_js.js + joy; in _glfwPlatformGetJoystickName() local
336 if (!pollJoystickEvents(js)) in _glfwPlatformGetJoystickName()
339 return js->name; in _glfwPlatformGetJoystickName()