Modules | Typedefs | Functions
Error handling

Modules

 Error codes
 

Typedefs

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

Functions

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

Detailed Description

Typedef Documentation

◆ GLFWerrorfun

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

This is the function signature for error callback functions.

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

Function Documentation

◆ glfwSetErrorCallback()

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.

Parameters
[in]cbfunThe new callback, or NULL to remove the currently set callback.
Returns
The previously set callback, or NULL if no callback was set or an error occurred.
Remarks
This function may be called before glfwInit.
Note
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.