Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Joystick.h

Go to the documentation of this file.
00001 // DirectInput Joystick Wrapper
00002 // Copyright 2001 by Jon Parise <jparise@cmu.edu>
00003 //
00004 // $Id: Joystick.h,v 1.1.1.1 2002/02/11 05:13:08 jon Exp $
00005 
00006 #ifndef __JOYSTICK_H__
00007 #define __JOYSTICK_H__
00008 
00009 #define DIRECTINPUT_VERSION 0x0800
00010 #include <dinput.h>
00011 
00012 class Joystick
00013 {
00014 private:
00015     unsigned int            deviceID;
00016     unsigned int            deviceCounter;
00017     
00018     LPDIRECTINPUT8          di;
00019     LPDIRECTINPUTDEVICE8    joystick;
00020 
00021 public:
00022     Joystick(unsigned int deviceID);
00023     ~Joystick();
00024 
00025     HRESULT deviceName(char* name);
00026 
00027     HRESULT open();
00028     HRESULT close();
00029 
00030     HRESULT poll(DIJOYSTATE2 *js);
00031 
00032     BOOL CALLBACK enumCallback(const DIDEVICEINSTANCE* instance, VOID* context);
00033 
00034     // Device Querying
00035     static unsigned int deviceCount();
00036 };
00037 
00038 BOOL CALLBACK enumCallback(const DIDEVICEINSTANCE* instance, VOID* context);
00039 BOOL CALLBACK countCallback(const DIDEVICEINSTANCE* instance, VOID* counter);
00040 
00041 #endif /* __JOYSTICK_H__ */

Generated on Mon Mar 4 08:42:23 2002 for Aria by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002