HydroSDL/joystick_SDL/joystick_SDL.cpp File Reference

#include "SDL.h"
#include "joystick_SDL.h"

Include dependency graph for joystick_SDL.cpp:

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?

Variables

int numJoy
int numAxes
int thereIsJoy = 0
SDL_Joystick * joystick


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.

Referenced by quit_tutorial().

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.

Referenced by DrawGLScene().

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.

Referenced by main().


Variable Documentation

SDL_Joystick* joystick

Definition at line 16 of file joystick_SDL.cpp.

Referenced by joystick_close(), joystick_getXYZR(), and joystick_init().

int numAxes

Definition at line 14 of file joystick_SDL.cpp.

Referenced by joystick_getXYZR(), and joystick_init().

int numJoy

Definition at line 13 of file joystick_SDL.cpp.

Referenced by joystick_close(), and joystick_init().

int thereIsJoy = 0

Definition at line 15 of file joystick_SDL.cpp.

Referenced by is_there_a_joystick(), and joystick_init().


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