|
MTek-GDL 0.100.4-muffintrap
|
Header for the controller class. More...
Go to the source code of this file.
Data Structures | |
| struct | WiiController |
| Struct representing the Wii controller. More... | |
Typedefs | |
| typedef enum WiiButtons | WiiButtons |
| typedef struct WiiController | WiiController |
Enumerations | |
| enum | WiiButtons { Button2 = 0x0001 , Button1 = 0x0002 , ButtonB = 0x0004 , ButtonA = 0x0008 , ButtonMinus = 0x0010 , ButtonHome = 0x0080 , ButtonLeft = 0x0100 , ButtonRight = 0x0200 , ButtonDown = 0x0400 , ButtonUp = 0x0800 , ButtonPlus = 0x1000 , ButtonZ = (0x0001 << 16) , ButtonC = (0x0002 << 16) } |
| Enum values for all the buttons on the Wii Controller. | |
Functions | |
| void | WiiController_Init (WiiController *controller, u8 channel) |
| Initialize a controller and set a channel for it. | |
| void | WiiController_ZeroAllInputs (WiiController *controller) |
| Zero all inputs on a controller. | |
| void | WiiController_StartFrame (WiiController *controller) |
| Prepares controller for input. | |
| bool | WiiController_ButtonPress (WiiController *controller, int buttonEnum) |
| Tells if a button was pressed down this frame. | |
| bool | WiiController_ButtonRelease (WiiController *controller, int buttonEnum) |
| Tells if a button was released this frame. | |
| bool | WiiController_ButtonHeld (WiiController *controller, int buttonEnum) |
| Tells if a button is down. | |
| vec2 | WiiController_GetCursorPosition (WiiController *controller) |
| Returns the position of the cursor. | |
| vec2 | WiiController_GetNunchukJoystickDirection (WiiController *controller) |
| Returns the direction of the nunchuck joystick. | |
| float | WiiController_GetRoll (WiiController *controller) |
| Returns the roll reported by the gyroscope in radians. | |
| float | WiiController_GetPitch (WiiController *controller) |
| Returns the pitch reported by the gyroscope in radians. | |
| float | WiiController_GetYaw (WiiController *controller) |
| Returns the yaw reported by the gyroscope in radians. | |
| const char * | WiiController_GetButtonSymbol (int buttonEnum) |
| void | _WiiController_SetButtonDown (WiiController *controller, int buttonEnum) |
| void | _WiiController_SetButtonUp (WiiController *controller, int buttonEnum) |
Header for the controller class.
| bool WiiController_ButtonHeld | ( | WiiController * | controller, |
| int | buttonEnum | ||
| ) |
Tells if a button is down.
| buttonEnum | The button to query. |
| bool WiiController_ButtonPress | ( | WiiController * | controller, |
| int | buttonEnum | ||
| ) |
Tells if a button was pressed down this frame.
| buttonEnum | The button to query. |
| bool WiiController_ButtonRelease | ( | WiiController * | controller, |
| int | buttonEnum | ||
| ) |
Tells if a button was released this frame.
| buttonEnum | The button to query. |
| vec2 WiiController_GetCursorPosition | ( | WiiController * | controller | ) |
Returns the position of the cursor.
| vec2 WiiController_GetNunchukJoystickDirection | ( | WiiController * | controller | ) |
Returns the direction of the nunchuck joystick.
| float WiiController_GetPitch | ( | WiiController * | controller | ) |
Returns the pitch reported by the gyroscope in radians.
| float WiiController_GetRoll | ( | WiiController * | controller | ) |
Returns the roll reported by the gyroscope in radians.
| float WiiController_GetYaw | ( | WiiController * | controller | ) |
Returns the yaw reported by the gyroscope in radians.
| void WiiController_Init | ( | WiiController * | controller, |
| u8 | channel | ||
| ) |
Initialize a controller and set a channel for it.
| channel | Channel of the controller. Valid values [0,3] |
| void WiiController_StartFrame | ( | WiiController * | controller | ) |
Prepares controller for input.
Releases all buttons and clears the list of released buttons. Call this before any input and code that reads controller state.
| void WiiController_ZeroAllInputs | ( | WiiController * | controller | ) |
Zero all inputs on a controller.
This releases all buttons and sets the joystick and roll to initial position.