Lines Matching defs:_glfw
42 _GLFWlibrary _glfw = { GLFW_FALSE };
44 // These are outside of _glfw so they can be used before initialization and
45 // after termination without special handling when _glfw is cleared to zero
98 memset(&_glfw.callbacks, 0, sizeof(_glfw.callbacks));
100 while (_glfw.windowListHead)
101 glfwDestroyWindow((GLFWwindow*) _glfw.windowListHead);
103 while (_glfw.cursorListHead)
104 glfwDestroyCursor((GLFWcursor*) _glfw.cursorListHead);
106 for (i = 0; i < _glfw.monitorCount; i++)
108 _GLFWmonitor* monitor = _glfw.monitors[i];
110 _glfw.platform.setGammaRamp(monitor, &monitor->originalRamp);
114 _glfw_free(_glfw.monitors);
115 _glfw.monitors = NULL;
116 _glfw.monitorCount = 0;
118 _glfw_free(_glfw.mappings);
119 _glfw.mappings = NULL;
120 _glfw.mappingCount = 0;
123 _glfw.platform.terminateJoysticks();
124 _glfw.platform.terminate();
126 _glfw.initialized = GLFW_FALSE;
128 while (_glfw.errorListHead)
130 _GLFWerror* error = _glfw.errorListHead;
131 _glfw.errorListHead = error->next;
135 _glfwPlatformDestroyTls(&_glfw.contextSlot);
136 _glfwPlatformDestroyTls(&_glfw.errorSlot);
137 _glfwPlatformDestroyMutex(&_glfw.errorLock);
139 memset(&_glfw, 0, sizeof(_glfw));
261 block = _glfw.allocator.allocate(count * size, _glfw.allocator.user);
278 void* resized = _glfw.allocator.reallocate(block, size, _glfw.allocator.user);
299 _glfw.allocator.deallocate(block, _glfw.allocator.user);
358 if (_glfw.initialized)
360 error = _glfwPlatformGetTls(&_glfw.errorSlot);
364 _glfwPlatformSetTls(&_glfw.errorSlot, error);
365 _glfwPlatformLockMutex(&_glfw.errorLock);
366 error->next = _glfw.errorListHead;
367 _glfw.errorListHead = error;
368 _glfwPlatformUnlockMutex(&_glfw.errorLock);
388 if (_glfw.initialized)
391 memset(&_glfw, 0, sizeof(_glfw));
392 _glfw.hints.init = _glfwInitHints;
394 _glfw.allocator = _glfwInitAllocator;
395 if (!_glfw.allocator.allocate)
397 _glfw.allocator.allocate = defaultAllocate;
398 _glfw.allocator.reallocate = defaultReallocate;
399 _glfw.allocator.deallocate = defaultDeallocate;
402 if (!_glfwSelectPlatform(_glfw.hints.init.platformID, &_glfw.platform))
405 if (!_glfw.platform.init())
411 if (!_glfwPlatformCreateMutex(&_glfw.errorLock) ||
412 !_glfwPlatformCreateTls(&_glfw.errorSlot) ||
413 !_glfwPlatformCreateTls(&_glfw.contextSlot))
419 _glfwPlatformSetTls(&_glfw.errorSlot, &_glfwMainThreadError);
424 _glfw.timer.offset = _glfwPlatformGetTimerValue();
426 _glfw.initialized = GLFW_TRUE;
434 if (!_glfw.initialized)
507 if (_glfw.initialized)
508 error = _glfwPlatformGetTls(&_glfw.errorSlot);