Gamedev Framework (gf)  0.3.0
A C++11 framework for 2D games
Public Member Functions | Static Public Member Functions | List of all members
gf::Gamepad Class Reference

Some gamepad related functions. More...

#include <gf/Gamepad.h>

Public Member Functions

 Gamepad ()=delete
 Deleted constructor. More...
 

Static Public Member Functions

static const char * getAxisName (GamepadAxis axis)
 Get the axis name. More...
 
static const char * getButtonName (GamepadButton button)
 Get the button name. More...
 
static void initialize ()
 Initialize the already connected gamepads. More...
 
Gamepad management
static GamepadId open (GamepadHwId hwid)
 Open a gamepad. More...
 
static bool isAttached (GamepadId id)
 Check if a gamepad is attached. More...
 
static void close (GamepadId id)
 Close a gamepad. More...
 
static const char * getName (GamepadId id)
 Get the name of the gamepad. More...
 

Detailed Description

Some gamepad related functions.

Constructor & Destructor Documentation

gf::Gamepad::Gamepad ( )
delete

Deleted constructor.

Member Function Documentation

static void gf::Gamepad::close ( GamepadId  id)
static

Close a gamepad.

Generally, this function is called after a GamepadDisconnected event.

Example:

Parameters
idThe gamepad id
See also
open()
static const char* gf::Gamepad::getAxisName ( GamepadAxis  axis)
static

Get the axis name.

Parameters
axisA gamepad axis
Returns
A string representation of the axis
static const char* gf::Gamepad::getButtonName ( GamepadButton  button)
static

Get the button name.

Parameters
buttonA gamepad button
Returns
A string representation of the button
static const char* gf::Gamepad::getName ( GamepadId  id)
static

Get the name of the gamepad.

Parameters
idThe gamepad id
Returns
A string representation of the gamepad
static void gf::Gamepad::initialize ( )
static

Initialize the already connected gamepads.

static bool gf::Gamepad::isAttached ( GamepadId  id)
static

Check if a gamepad is attached.

Parameters
idThe gamepad id
Returns
True if the gamepad is attached
static GamepadId gf::Gamepad::open ( GamepadHwId  hwid)
static

Open a gamepad.

Generally, this function is called after a GamepadConnected event.

Example:

// do something with id
}
Parameters
hwidThe hardware identifier
Returns
The identifier of the gamepad
See also
close()