All Data Structures Files Functions Variables Typedefs Macros Modules Pages
Modules | Typedefs | Functions
Error handling


 Error codes


typedef void(* GLFWerrorfun )(int, const char *)
 The function signature for error callbacks. More...


GLFWerrorfun glfwSetErrorCallback (GLFWerrorfun cbfun)
 Sets the error callback. More...

Detailed Description

Typedef Documentation

typedef void(* GLFWerrorfun)(int, const char *)

This is the function signature for error callback functions.

[in]errorAn error code.
[in]descriptionA UTF-8 encoded string describing the error.
See also

Function Documentation

GLFWerrorfun glfwSetErrorCallback ( GLFWerrorfun  cbfun)

This function sets the error callback, which is called with an error code and a human-readable description each time a GLFW error occurs.

[in]cbfunThe new callback, or NULL to remove the currently set callback.
The previously set callback, or NULL if no callback was set or an error occurred.
This function may be called before glfwInit.
The error callback is called by the thread where the error was generated. If you are using GLFW from multiple threads, your error callback needs to be written accordingly.
Because the description string provided to the callback may have been generated specifically for that error, it is not guaranteed to be valid after the callback has returned. If you wish to use it after that, you need to make your own copy of it before returning.