MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / glfwInit

Function glfwInit

extern/glfw/src/init.c:316–347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314//////////////////////////////////////////////////////////////////////////
315
316GLFWAPI 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
349GLFWAPI void glfwTerminate(void)
350{

Callers 1

initMethod · 0.85

Calls 8

terminateFunction · 0.85
_glfwInitGamepadMappingsFunction · 0.85
glfwDefaultWindowHintsFunction · 0.85
_glfwPlatformInitFunction · 0.70
_glfwPlatformCreateMutexFunction · 0.70
_glfwPlatformCreateTlsFunction · 0.70
_glfwPlatformSetTlsFunction · 0.70

Tested by

no test coverage detected