Controller Library


Enumerations

enum  pgeCtrlButtons {
  PGE_CTRL_SELECT = PSP_CTRL_SELECT,
  PGE_CTRL_START = PSP_CTRL_START,
  PGE_CTRL_UP = PSP_CTRL_UP,
  PGE_CTRL_RIGHT = PSP_CTRL_RIGHT,
  PGE_CTRL_DOWN = PSP_CTRL_DOWN,
  PGE_CTRL_LEFT = PSP_CTRL_LEFT,
  PGE_CTRL_LTRIGGER = PSP_CTRL_LTRIGGER,
  PGE_CTRL_RTRIGGER = PSP_CTRL_RTRIGGER,
  PGE_CTRL_TRIANGLE = PSP_CTRL_TRIANGLE,
  PGE_CTRL_CIRCLE = PSP_CTRL_CIRCLE,
  PGE_CTRL_CROSS = PSP_CTRL_CROSS,
  PGE_CTRL_SQUARE = PSP_CTRL_SQUARE
}

Functions

int pgeControlsInit (void)
void pgeControlsShutdown (void)
void pgeControlsUpdate (void)
int pgeControlsPressedAny (void)
int pgeControlsPressed (const unsigned int buttons)
int pgeControlsHeldAny (void)
int pgeControlsHeld (const unsigned int buttons)
int pgeControlsReleasedAny (void)
int pgeControlsReleased (const unsigned int buttons)
char pgeControlsAnalogX (void)
char pgeControlsAnalogY (void)
float pgeControlsAnalogAngle (void)
float pgeControlsAnalogMag (void)
void pgeControlsEnable (void)
void pgeControlsDisable (void)

Enumeration Type Documentation

Enumerator for buttons

Enumerator:
PGE_CTRL_SELECT  Select button.
PGE_CTRL_START  Start button.
PGE_CTRL_UP  Up D-Pad button.
PGE_CTRL_RIGHT  Right D-Pad button.
PGE_CTRL_DOWN  Down D-Pad button.
PGE_CTRL_LEFT  Left D-Pad button.
PGE_CTRL_LTRIGGER  Left trigger.
PGE_CTRL_RTRIGGER  Right trigger.
PGE_CTRL_TRIANGLE  Triangle button.
PGE_CTRL_CIRCLE  Circle button.
PGE_CTRL_CROSS  Cross button.
PGE_CTRL_SQUARE  Square button.


Function Documentation

float pgeControlsAnalogAngle ( void   ) 

Get the analog angle

Returns:
The angle in radians

float pgeControlsAnalogMag ( void   ) 

Get the analog magnitude

Returns:
The magnitude

char pgeControlsAnalogX ( void   ) 

Get the analog X position

Returns:
The current value of the analog X position, -128 to 127, -128 being fully left, 127 being fully right

char pgeControlsAnalogY ( void   ) 

Get the analog Y position

Returns:
The current value of the analog Y position, -128 to 127, -128 being fully up, 127 being fully down

void pgeControlsDisable ( void   ) 

Disables the controls

void pgeControlsEnable ( void   ) 

Enables the controls

Note:
The controls are enabled by default

int pgeControlsHeld ( const unsigned int  buttons  ) 

Check for a button being held

Parameters:
buttons - The button types (PGE_CTRL_*) to check for
Returns:
1 if buttons pressed, 0 if not pressed

int pgeControlsHeldAny ( void   ) 

Check for ANY button being held

Returns:
1 on any button being pressed, 0 if no buttons are pressed

int pgeControlsInit ( void   ) 

Init the controls

Returns:
1 on success

int pgeControlsPressed ( const unsigned int  buttons  ) 

Check for a button being pressed

Parameters:
buttons - The button types (PGE_CTRL_*) to check for
Returns:
1 if buttons pressed, 0 if not pressed

int pgeControlsPressedAny ( void   ) 

Check for ANY button being pressed

Returns:
1 on any button being pressed, 0 if no buttons are pressed

int pgeControlsReleased ( const unsigned int  buttons  ) 

Check for a button being released

Parameters:
buttons - The button types (PGE_CTRL_*) to check for
Returns:
1 if buttons released, 0 if not pressed

int pgeControlsReleasedAny ( void   ) 

Check for ANY button being released

Returns:
1 on any button being released, 0 if no buttons are released

void pgeControlsShutdown ( void   ) 

Shutdown the controls

void pgeControlsUpdate ( void   ) 

Update the controls

Should be called once at the start of each iteration of your main loop


Generated on Mon Sep 22 16:58:14 2008 for Phoenix Game Engine by  doxygen 1.5.5