GLFW 3.0.2 A multi-platform library for OpenGL, window and input

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

All Data Structures Files Functions Variables Typedefs Macros Groups Pages
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

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

This is the function signature for error callback functions.

Parameters

  [in] | error | An error code.
  [in] | description | A UTF-8 encoded string describing the error.

See Also
  glfwSetErrorCallback

## 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.

Parameters

  [in] | cbfun | The 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.