VOX
A little voxel engine
Loading...
Searching...
No Matches
Input Class Reference

#include <input.hpp>

Collaboration diagram for Input:
Collaboration graph

Public Types

enum class  KeyState { RELEASED = GLFW_RELEASE , PRESSED = GLFW_PRESS , REPEATED = GLFW_REPEAT , NONE }
 

Public Member Functions

 Input (GLFWwindow *glfwWindow)
 Construct a new Input object. More...
 
 ~Input ()
 Destroy the Input object. More...
 
KeyState getKeyState (int key)
 Get the key state. More...
 
KeyState getMouseButtonState (int button)
 Get the mouse button state. More...
 
void getCursorPos (double &xpos, double &ypos)
 Get the cursor position. More...
 
bool isCursorCaptured ()
 
void getScroll (double &xoffset, double &yoffset)
 Get the scroll values. More...
 

Member Enumeration Documentation

◆ KeyState

enum class Input::KeyState
strong
Enumerator
RELEASED 
PRESSED 
REPEATED 
NONE 

Constructor & Destructor Documentation

◆ Input()

Input::Input ( GLFWwindow *  glfwWindow)

Construct a new Input object.

Parameters
glfwWindowThe GLFWwindow object

◆ ~Input()

Input::~Input ( )

Destroy the Input object.

Member Function Documentation

◆ getCursorPos()

void Input::getCursorPos ( double &  xpos,
double &  ypos 
)

Get the cursor position.

Parameters
xposThe x position of the cursor
yposThe y position of the cursor

◆ getKeyState()

Input::KeyState Input::getKeyState ( int  key)

Get the key state.

Parameters
keyThe key to get the state of
Returns
KeyState The state of the key

◆ getMouseButtonState()

Input::KeyState Input::getMouseButtonState ( int  button)

Get the mouse button state.

Parameters
buttonThe button to get the state of
Returns
KeyState The state of the button

◆ getScroll()

void Input::getScroll ( double &  xoffset,
double &  yoffset 
)

Get the scroll values.

Parameters
xoffsetThe x offset of the scroll
yoffsetThe y offset of the scroll

◆ isCursorCaptured()

bool Input::isCursorCaptured ( )
inline

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