| 314 | ////////////////////////////////////////////////////////////////////////// |
| 315 | |
| 316 | GLFWAPI int glfwInit(void) |
| 317 | { |
| 318 | if (_glfw.initialized) |
| 319 | return GLFW_TRUE; |
| 320 | |
| 321 | memset(&_glfw, 0, sizeof(_glfw)); |
| 322 | _glfw.hints.init = _glfwInitHints; |
| 323 | |
| 324 | if (!_glfwPlatformInit()) |
| 325 | { |
| 326 | terminate(); |
| 327 | return GLFW_FALSE; |
| 328 | } |
| 329 | |
| 330 | if (!_glfwPlatformCreateMutex(&_glfw.errorLock) || |
| 331 | !_glfwPlatformCreateTls(&_glfw.errorSlot) || |
| 332 | !_glfwPlatformCreateTls(&_glfw.contextSlot)) |
| 333 | { |
| 334 | terminate(); |
| 335 | return GLFW_FALSE; |
| 336 | } |
| 337 | |
| 338 | _glfwPlatformSetTls(&_glfw.errorSlot, &_glfwMainThreadError); |
| 339 | |
| 340 | _glfwInitGamepadMappings(); |
| 341 | |
| 342 | _glfw.initialized = GLFW_TRUE; |
| 343 | _glfw.timer.offset = _glfwPlatformGetTimerValue(); |
| 344 | |
| 345 | glfwDefaultWindowHints(); |
| 346 | return GLFW_TRUE; |
| 347 | } |
| 348 | |
| 349 | GLFWAPI void glfwTerminate(void) |
| 350 | { |
no test coverage detected