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::MouseButtonCallback Class Reference

This class wraps a GLFW mouse button callback. More...

#include <glfw_callback.hpp>

Public Member Functions

 MouseButtonCallback (void)
 Creates a mouse button callback. More...
 
 ~MouseButtonCallback (void)
 Creates a mouse button callback. More...
 
virtual void invoke (GLFWwindow *window, MouseButton button, Action action, Modifier mods)
 This function gets called whenever a mouse button is pressed or released. More...
 

Static Public Member Functions

static MouseButtonCallbackgetCurrent ()
 Returns the current mouse button callback. More...
 
static void setCurrent (MouseButtonCallback *callback)
 Sets the current mouse button callback. More...
 
static void dispatch (GLFWwindow *window, int button, int action, int mods)
 Dispatches the member function. More...
 

Static Protected Attributes

static MouseButtonCallbackcurrent = nullptr
 Stores the current instance of the mouse button callback. More...
 

Detailed Description

This class wraps a GLFW mouse button callback.

Definition at line 130 of file glfw_callback.hpp.

Constructor & Destructor Documentation

sgl::MouseButtonCallback::MouseButtonCallback ( void  )

Creates a mouse button callback.

Definition at line 109 of file glfw_callback.cpp.

sgl::MouseButtonCallback::~MouseButtonCallback ( void  )

Creates a mouse button callback.

Definition at line 113 of file glfw_callback.cpp.

Member Function Documentation

void sgl::MouseButtonCallback::dispatch ( GLFWwindow *  window,
int  button,
int  action,
int  mods 
)
static

Dispatches the member function.

Parameters
windowThe window which received the event.
buttonThe button of the event.
actionThe action of the event.
modsA bit field that describes which modifier keys were active.

Definition at line 102 of file glfw_callback.cpp.

MouseButtonCallback * sgl::MouseButtonCallback::getCurrent ( )
static

Returns the current mouse button callback.

Returns
The current mouse button callback.

Definition at line 91 of file glfw_callback.cpp.

void sgl::MouseButtonCallback::invoke ( GLFWwindow *  window,
MouseButton  button,
Action  action,
Modifier  mods 
)
virtual

This function gets called whenever a mouse button is pressed or released.

Default implementation of the mouse button callback.

Parameters
windowThe window which received the event.
buttonThe button of the event.
actionThe action of the event.
modsA bit field that describes which modifier keys were active.

Definition at line 121 of file glfw_callback.cpp.

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

Sets the current mouse button callback.

Parameters
callbackThe mouse button callback to set.

Definition at line 95 of file glfw_callback.cpp.

Member Data Documentation

MouseButtonCallback * sgl::MouseButtonCallback::current = nullptr
staticprotected

Stores the current instance of the mouse button callback.

Definition at line 134 of file glfw_callback.hpp.


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