HydroSDL/joystick_SDL/joystick_SDL.h File Reference

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int joystick_init ()
 Joystick initialisation.
void joystick_getXYZR (float *X, float *Y, float *Z, float *R, bool doX, bool doY, bool doZ, bool doR)
 Get joystick position.
void joystick_close ()
 Close joystick.
int is_there_a_joystick ()
 Does a joystick exists?


Detailed Description

Author:
basile.graf@epfl.ch
This file contains stuff related to the joystick. Cross-platform thanks to SDL.

Definition in file joystick_SDL.h.


Function Documentation

int is_there_a_joystick (  ) 

Does a joystick exists?

Returns:
: 1 => there is one. 0 => there is no joystick.

Definition at line 99 of file joystick_SDL.cpp.

References thereIsJoy.

Referenced by DrawGLScene().

void joystick_close (  ) 

Close joystick.

If a joystick has been opened, this function closes it...

Definition at line 85 of file joystick_SDL.cpp.

References joystick, and numJoy.

void joystick_getXYZR ( float *  X,
float *  Y,
float *  Z,
float *  R,
bool  doX,
bool  doY,
bool  doZ,
bool  doR 
)

Get joystick position.

Returns the actual joystick position (of selected axes via corresponding boolean doX...Z)

Parameters:
doX : TRUE: get X position and modify the *X value. FALSE: Do not modify *X.
doY : TRUE: get Y position and modify the *Y value. FALSE: Do not modify *Y.
doZ : TRUE: get Z position and modify the *Z value. FALSE: Do not modify *Z.
doR : TRUE: get R position and modify the *R value. FALSE: Do not modify *R.
*X : Adress of the X value to be modified or not.
*Y : Adress of the Y value to be modified or not.
*Z : Adress of the Z value to be modified or not.
*R : Adress of the R value to be modified or not.

Definition at line 68 of file joystick_SDL.cpp.

References f(), joystick, and numAxes.

int joystick_init (  ) 

Joystick initialisation.

This function tries to open the joystick if one is connected. If no joystick is found, the programm uses keyboard controll

Definition at line 24 of file joystick_SDL.cpp.

References joystick, numAxes, numJoy, and thereIsJoy.


Generated on Wed Sep 20 14:30:04 2006 for hydroSDL by  doxygen 1.4.7