Added glfwIsInitialized function

This commit is contained in:
Frostie314159 2022-03-30 22:33:26 +02:00
parent 955fbd9d26
commit a2626714ef
2 changed files with 22 additions and 0 deletions

View File

@ -2364,6 +2364,22 @@ GLFWAPI const char* glfwGetVersionString(void);
*/
GLFWAPI int glfwGetError(const char** description);
/*! @brief Returns the initialization state.
* This function returns whether the library has been initialized or not.
* @return `GLFW_TRUE` if initialized, or `GLFW_FALSE` otherwise.
*
* @errors None.
*
* @remark This function may be called before @ref glfwInit.
*
* @thread_safety This function may be called from any thread.
*
* @since Added in version 3.3.6
*
* @ingroup init
*/
GLFWAPI int glfwIsInitialized(void);
/*! @brief Sets the error callback.
*
* This function sets the error callback, which is called with an error code
@ -2408,6 +2424,7 @@ GLFWAPI int glfwGetError(const char** description);
*
* @ingroup init
*/
GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun callback);
/*! @brief Returns the currently selected platform.

View File

@ -484,6 +484,11 @@ GLFWAPI int glfwGetError(const char** description)
return code;
}
GLFWAPI int glfwIsInitialized(void)
{
return _glfw.initialized;
}
GLFWAPI GLFWerrorfun glfwSetErrorCallback(GLFWerrorfun cbfun)
{
_GLFW_SWAP(GLFWerrorfun, _glfwErrorCallback, cbfun);