glfwGetError

Returns and clears the last error for the calling thread.

This function returns and clears the error code of the last error that occurred on the calling thread, and optionally a UTF-8 encoded human-readable description of it. If no error has occurred since the last call, it returns @ref GLFW_NO_ERROR (zero) and the description pointer is set to null.

extern (C) @nogc nothrow __gshared
int
glfwGetError
(
const(char)** description
)

Parameters

description const(char)**

Where to store the error description pointer, or null.

Return Value

Type: int

The last error code for the calling thread, or @ref GLFW_NO_ERROR (zero).

Errors: None.

Pointer lifetime

The returned string is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the next error occurs or the library is terminated.

@remark This function may be called before @ref glfwInit.

Thread Safety

This function may be called from any thread.

@sa @ref error_handling @sa @ref glfwSetErrorCallback

Meta

Since

Added in version 3.3.

Ingroup: init