mirror of
https://github.com/glfw/glfw.git
synced 2026-09-22 08:50:15 +00:00
Added macros for library initialization check.
This commit is contained in:
+2
-12
@@ -37,23 +37,13 @@
|
||||
|
||||
GLFWAPI double glfwGetTime(void)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
{
|
||||
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
_GLFW_REQUIRE_INIT_OR_RETURN(0.0);
|
||||
return _glfwPlatformGetTime();
|
||||
}
|
||||
|
||||
GLFWAPI void glfwSetTime(double time)
|
||||
{
|
||||
if (!_glfwInitialized)
|
||||
{
|
||||
_glfwInputError(GLFW_NOT_INITIALIZED, NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
_GLFW_REQUIRE_INIT();
|
||||
_glfwPlatformSetTime(time);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user