SimpleGL  1.1.0
A framework for platform independent rendering
Public Member Functions | Static Public Member Functions | Static Protected Attributes | List of all members
sgl::ErrorCallback Class Reference

This class wraps a GLFW error callback. More...

#include <glfw_callback.hpp>

Public Member Functions

 ErrorCallback (void)
 Creates an error callback. More...
 
 ~ErrorCallback (void)
 Destroys an error callback. More...
 
virtual void invoke (int error, std::string description)
 This function gets called whenever a GLFW error occurs. More...
 

Static Public Member Functions

static ErrorCallbackgetCurrent ()
 Returns the current error callback. More...
 
static void setCurrent (ErrorCallback *callback)
 Sets the current error callback. More...
 
static void dispatch (int error, const char *description)
 Dispatches the member function. More...
 

Static Protected Attributes

static ErrorCallbackcurrent = nullptr
 Stores the current instance of the error callback. More...
 

Detailed Description

This class wraps a GLFW error callback.

Definition at line 26 of file glfw_callback.hpp.

Constructor & Destructor Documentation

sgl::ErrorCallback::ErrorCallback ( void  )

Creates an error callback.

Definition at line 36 of file glfw_callback.cpp.

sgl::ErrorCallback::~ErrorCallback ( void  )

Destroys an error callback.

Definition at line 40 of file glfw_callback.cpp.

Member Function Documentation

void sgl::ErrorCallback::dispatch ( int  error,
const char *  description 
)
static

Dispatches the member function.

Parameters
errorAn error code.
descriptionA UTF-8 encoded string describing the error.

Definition at line 29 of file glfw_callback.cpp.

ErrorCallback * sgl::ErrorCallback::getCurrent ( )
static

Returns the current error callback.

Returns
The current error callback.

Definition at line 18 of file glfw_callback.cpp.

void sgl::ErrorCallback::invoke ( int  error,
std::string  description 
)
virtual

This function gets called whenever a GLFW error occurs.

Default implementation of the error callback.

Parameters
errorAn error code.
descriptionDescription of the error.

Definition at line 48 of file glfw_callback.cpp.

void sgl::ErrorCallback::setCurrent ( ErrorCallback callback)
static

Sets the current error callback.

Parameters
callbackThe error callback to set.

Definition at line 22 of file glfw_callback.cpp.

Member Data Documentation

ErrorCallback * sgl::ErrorCallback::current = nullptr
staticprotected

Stores the current instance of the error callback.

Definition at line 30 of file glfw_callback.hpp.


The documentation for this class was generated from the following files: