00001 // ---------------------------------------------------------------------------- 00002 // 00003 // tagGame - Example code from the book: 00004 // 00005 // Artficial Intelligence for Computer Games: An Introduction 00006 // by John David Funge 00007 // 00008 // www.ai4games.org 00009 // 00010 // Source code distributed under the Copyright (c) 2003-2007, John David Funge 00011 // Original author: John David Funge (www.jfunge.com) 00012 // 00013 // Licensed under the Academic Free License version 3.0 00014 // (for details see LICENSE.txt in this directory). 00015 // 00016 // ---------------------------------------------------------------------------- 00017 00018 #ifndef TG_JOYSTICK_SDL_H 00019 #define TG_JOYSTICK_SDL_H 00020 00021 #include "MathUtil.h" 00022 00023 typedef struct _SDL_Joystick SDL_Joystick; 00024 00025 namespace tagGame 00026 { 00028 class JoystickSDL 00029 { 00030 public: 00031 JoystickSDL(); 00032 ~JoystickSDL(); 00033 00034 bool init(); 00035 00036 // Returns a value from -1 to 1. 00037 Real getX(); 00038 // Return a value from -1 to 1. 00039 Real getY(); 00040 protected: 00041 private: 00042 SDL_Joystick* joystick; 00043 }; 00044 } 00045 00046 #endif
1.5.1