Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Input

Enumerations

enum  Ult::INPUT_BUTTON {
  Ult::BUTTON_LEFT_SHOULDER = 1 , Ult::BUTTON_RIGHT_SHOULDER , Ult::BUTTON_LEFT_TRIGGER , Ult::BUTTON_RIGHT_TRIGGER ,
  Ult::BUTTON_LEFT_THUMB , Ult::BUTTON_RIGHT_THUMB , Ult::BUTTON_START , Ult::BUTTON_BACK ,
  Ult::BUTTON_ARROW_UP , Ult::BUTTON_ARROW_DOWN , Ult::BUTTON_ARROW_LEFT , Ult::BUTTON_ARROW_RIGHT ,
  Ult::BUTTON_A , Ult::BUTTON_B , Ult::BUTTON_X , Ult::BUTTON_Y ,
  Ult::BUTTON_MOUSE_LEFT , Ult::BUTTON_MOUSE_RIGHT , Ult::BUTTON_0 , Ult::BUTTON_1 ,
  Ult::BUTTON_2 , Ult::BUTTON_3 , Ult::BUTTON_4 , Ult::BUTTON_5 ,
  Ult::BUTTON_6 , Ult::BUTTON_7 , Ult::BUTTON_8 , Ult::BUTTON_9 ,
  Ult::BUTTON_C , Ult::BUTTON_D , Ult::BUTTON_E , Ult::BUTTON_F ,
  Ult::BUTTON_G , Ult::BUTTON_H , Ult::BUTTON_I , Ult::BUTTON_J ,
  Ult::BUTTON_K , Ult::BUTTON_L , Ult::BUTTON_M , Ult::BUTTON_N ,
  Ult::BUTTON_O , Ult::BUTTON_P , Ult::BUTTON_Q , Ult::BUTTON_R ,
  Ult::BUTTON_S , Ult::BUTTON_T , Ult::BUTTON_U , Ult::BUTTON_V ,
  Ult::BUTTON_W , Ult::BUTTON_Z , Ult::BUTTON_ESCAPE , Ult::BUTTON_SPACE ,
  Ult::BUTTON_ENTER , Ult::BUTTON_TOTAL_BUTTONS
}
 

Functions

void Ult::InitInput ()
 
void Ult::UpdateInput ()
 
void Ult::DeinitInput ()
 
bool Ult::IsButtonDown (const INPUT_BUTTON btn)
 
bool Ult::IsButtonUp (const INPUT_BUTTON btn, const bool wasDown)
 
void Ult::GetMousePosition (int *mx, int *my)
 
bool Ult::GetWindowResize (int *width, int *height)
 

Variables

bool Ult::gShouldQuit = false
 

Detailed Description

Enumeration Type Documentation

◆ INPUT_BUTTON

Enumerator
BUTTON_LEFT_SHOULDER 
BUTTON_RIGHT_SHOULDER 
BUTTON_LEFT_TRIGGER 
BUTTON_RIGHT_TRIGGER 
BUTTON_LEFT_THUMB 
BUTTON_RIGHT_THUMB 
BUTTON_START 
BUTTON_BACK 
BUTTON_ARROW_UP 
BUTTON_ARROW_DOWN 
BUTTON_ARROW_LEFT 
BUTTON_ARROW_RIGHT 
BUTTON_A 
BUTTON_B 
BUTTON_X 
BUTTON_Y 
BUTTON_MOUSE_LEFT 
BUTTON_MOUSE_RIGHT 
BUTTON_0 
BUTTON_1 
BUTTON_2 
BUTTON_3 
BUTTON_4 
BUTTON_5 
BUTTON_6 
BUTTON_7 
BUTTON_8 
BUTTON_9 
BUTTON_C 
BUTTON_D 
BUTTON_E 
BUTTON_F 
BUTTON_G 
BUTTON_H 
BUTTON_I 
BUTTON_J 
BUTTON_K 
BUTTON_L 
BUTTON_M 
BUTTON_N 
BUTTON_O 
BUTTON_P 
BUTTON_Q 
BUTTON_R 
BUTTON_S 
BUTTON_T 
BUTTON_U 
BUTTON_V 
BUTTON_W 
BUTTON_Z 
BUTTON_ESCAPE 
BUTTON_SPACE 
BUTTON_ENTER 
BUTTON_TOTAL_BUTTONS 

Function Documentation

◆ DeinitInput()

void Ult::DeinitInput ( )

Deinitialize the input system.

◆ GetMousePosition()

void Ult::GetMousePosition ( int * mx,
int * my )

Store the position of the mouse cursor as of the last UpdateInput call in mx and my.

◆ GetWindowResize()

bool Ult::GetWindowResize ( int * width,
int * height )

If the window was resized, set width and height to the new size and return true. Otherwise, return false.

◆ InitInput()

void Ult::InitInput ( )

Initialize the input system. Should be called once during game initialization.

◆ IsButtonDown()

bool Ult::IsButtonDown ( const INPUT_BUTTON btn)

Returns true if the input button is pressed down as of the last UpdateInput call.

◆ IsButtonUp()

bool Ult::IsButtonUp ( const INPUT_BUTTON btn,
const bool wasDown )

Returns true if the input button is not pressed down and wasDown is true.

◆ UpdateInput()

void Ult::UpdateInput ( )

Update the input system. Reads from game inputs and stores their state.

Variable Documentation

◆ gShouldQuit

bool Ult::gShouldQuit = false

Automatically set by UpdateInput. Is set to true when the window is given the signal to close.