Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Functions
Input

Handle user input through keyboard, mouse and controllers and provide controllable cameras.

The Input manager is keeping track of the internal input state based on all external events. Support for common game controllers is provided through GLFW with a common mapping system. This module also provides simple and interactive cameras for inspecting scenes.

Classes

class  Camera
 This class represents a camera as used in real-time rendering APIs. It provides a view and projection matrices, and handles their proper update. More...
 
class  ControllableCamera
 This camera can be controlled through the inputs received from the user. More...
 
class  Controller
 Represents a joystick or any additional controller. More...
 
class  GamepadController
 Represents a controller with a predefined mapping provided by GLFW/SDL. More...
 
class  RawController
 Represents a controller used for debug, where all raw buttons are shown. More...
 
class  Input
 The input manager is responsible for updating the internal input states (keyboard, mouse, window size). It can also be use to query back these states. More...
 

Functions

void resize_callback (GLFWwindow *window, int width, int height)
 
void key_callback (GLFWwindow *window, int key, int scancode, int action, int mods)
 
void char_callback (GLFWwindow *window, unsigned int codepoint)
 
void mouse_button_callback (GLFWwindow *window, int button, int action, int mods)
 
void cursor_pos_callback (GLFWwindow *window, double xpos, double ypos)
 
void scroll_callback (GLFWwindow *window, double xoffset, double yoffset)
 
void iconify_callback (GLFWwindow *window, int state)
 
void joystick_callback (int joy, int event)
 

Function Documentation

◆ char_callback()

void char_callback ( GLFWwindow *  window,
unsigned int  codepoint 
)

Callback for text characters.

Parameters
windowthe GLFW window pointer
codepointthe character codepoint

◆ cursor_pos_callback()

void cursor_pos_callback ( GLFWwindow *  window,
double  xpos,
double  ypos 
)

Callback for cursor position events.

Parameters
windowthe GLFW window pointer
xposthe horizontal position of the cursor, in pixels
yposthe vertical position of the cursor, in pixels
Note
An event is received at each frame with the current mouse position.

◆ iconify_callback()

void iconify_callback ( GLFWwindow *  window,
int  state 
)

Callback for window minimizing events.

Parameters
windowthe GLFW window pointer
statethe new state of the window

◆ joystick_callback()

void joystick_callback ( int  joy,
int  event 
)

Callback for joystick (de)connection events.

Parameters
joythe index of the joystick
eventthe event GLFW code

◆ key_callback()

void key_callback ( GLFWwindow *  window,
int  key,
int  scancode,
int  action,
int  mods 
)

Callback for key press/release events.

Parameters
windowthe GLFW window pointer
keythe key GLFW code
scancodea platform-specific key code
actionthe performed action GLFW code
modsthe applied modifiers (alt, ctrl,...) GLFW code

◆ mouse_button_callback()

void mouse_button_callback ( GLFWwindow *  window,
int  button,
int  action,
int  mods 
)

Callback for mouse buttons press/release events.

Parameters
windowthe GLFW window pointer
buttonthe button GLFW code
actionthe performed action GLFW code
modsthe applied modifiers (alt, ctrl,...) GLFW code

◆ resize_callback()

void resize_callback ( GLFWwindow *  window,
int  width,
int  height 
)

Callback for window resizing events.

Parameters
windowthe GLFW window pointer
widththe new width of the window
heightthe new height of the window

◆ scroll_callback()

void scroll_callback ( GLFWwindow *  window,
double  xoffset,
double  yoffset 
)

Callback for mouse scroll events.

Parameters
windowthe GLFW window pointer
xoffsetthe horizontal amount of scrolling
yoffsetthe vertical amount of scrolling
Note
The scroll amounts are in arbitrary units.