E:/Download/ois-1.0RC1/includes/OISPrereqs.h

Go to the documentation of this file.
00001 /*
00002 The zlib/libpng License
00003 
00004 Copyright (c) 2006 Phillip Castaneda (pjcast -- www.wreckedgames.com)
00005 
00006 This software is provided 'as-is', without any express or implied warranty. In no event will
00007 the authors be held liable for any damages arising from the use of this software.
00008 
00009 Permission is granted to anyone to use this software for any purpose, including commercial
00010 applications, and to alter it and redistribute it freely, subject to the following
00011 restrictions:
00012 
00013     1. The origin of this software must not be misrepresented; you must not claim that
00014                 you wrote the original software. If you use this software in a product,
00015                 an acknowledgment in the product documentation would be appreciated but is
00016                 not required.
00017 
00018     2. Altered source versions must be plainly marked as such, and must not be
00019                 misrepresented as being the original software.
00020 
00021     3. This notice may not be removed or altered from any source distribution.
00022 */
00023 #ifndef OIS_Prereqs_H
00024 #define OIS_Prereqs_H
00025 //----------------------------------------------------------------------------//
00026 //* This Header File contains forward declared classes                       *//
00027 //*     Also, common properties for the keyboard and mouse                       *//
00028 //* There is also preprocessor defines to determine type of OS               *//
00029 //----------------------------------------------------------------------------//
00030 
00031 //-------------- Common STL Containers ---------------------------------------//
00032 #include <vector>
00033 #include <string>
00034 #include <map>
00035 #include "OISConfig.h"
00036 
00037 // Default is blank for most OS's
00038 #define _OISExport
00039 
00040 //-------------- Determine Compiler ---------------------------------
00041 #if defined( _MSC_VER )
00042 #       define OIS_MSVC_COMPILER
00043 #elif defined( __GNUC__ )
00044 #       if defined( __WIN32__ ) || defined( _WIN32 )
00045 #               define OIS_MINGW_COMPILER
00046 #       else
00047 #               define OIS_GCC_COMPILER
00048 #       endif
00049 #elif defined( __BORLANDC__ )
00050 #       define OIS_BORLAND_COMPILER
00051 #else
00052 #       error No Recognized Compiler!
00053 #endif
00054 
00055 // --------------- Determine Operating System Platform ---------------
00056 #if defined( __WIN32__ ) || defined( _WIN32 ) // Windows 2000, XP, ETC
00057 #       if defined ( _XBOX )
00058 #               define OIS_XBOX_PLATFORM
00059 #       else
00060 #               define OIS_WIN32_PLATFORM
00061 #               if defined( OIS_DYNAMIC_LIB ) && !defined(OIS_MINGW_COMPILER)
00062 #                       undef _OISExport
00063                         //Ignorable Dll interface warning...
00064 #                       pragma warning (disable : 4251)
00065 #                       if defined( OIS_NONCLIENT_BUILD )
00066 #                               define _OISExport __declspec( dllexport )
00067 #                       else
00068 #                               define _OISExport __declspec( dllimport )
00069 #                       endif
00070 #               endif
00071 #       endif
00072 #elif defined( __APPLE_CC__ ) // Apple OS X
00073 #       define OIS_APPLE_PLATFORM
00074 #else //Probably Linux
00075 #       define OIS_LINUX_PLATFORM
00076 #endif
00077 
00078 //Is Processor 32 or 64 bits...
00079 #if defined(__x86_64__)
00080 #       define OIS_ARCH_64
00081 #else
00082 #       define OIS_ARCH_32
00083 #endif
00084 
00085 //-------------- Common Classes, Enums, and Typdef's -------------------------//
00086 #define OIS_VERSION_MAJOR 1
00087 #define OIS_VERSION_MINOR 0
00088 #define OIS_VERSION_PATCH 0
00089 #define OIS_VERSION_NAME "Nitro"
00090 
00091 #define OIS_VERSION ((OIS_VERSION_MAJOR << 16) | (OIS_VERSION_MINOR << 8) | OIS_VERSION_PATCH)
00092 
00093 namespace OIS
00094 {
00095         //Device Types
00096         class InputManager;
00097         class Object;
00098         class Keyboard;
00099         class Mouse;
00100         class JoyStick;
00101         class KeyListener;
00102         class MouseListener;
00103         class JoyStickListener;
00104         class Interface;
00105         class ForceFeedback;
00106         class Effect;
00107 
00109         typedef _OISExport std::multimap<std::string, std::string> ParamList;
00110 
00112         enum _OISExport Type
00113         {
00114                 OISUnknown   = 0,
00115                 OISKeyboard  = 1,
00116                 OISMouse     = 2,
00117                 OISJoyStick  = 3,
00118                 OISTablet    = 4
00119         };
00120 
00121         //--------     Shared common components    ------------------------//
00122 
00124         enum _OISExport ComponentType
00125         {
00126                 OIS_Unknown = 0,
00127                 OIS_Button  = 1, //Key, mouse button, joy button, etc
00128                 OIS_Axis    = 2,
00129                 OIS_Slider  = 3,
00130                 OIS_POV     = 4
00131         };
00132 
00134         struct _OISExport Component
00135         {
00136                 Component() : cType(OIS_Unknown) {};
00137                 Component(ComponentType type) : cType(type) {};
00139                 ComponentType cType;
00140         };
00141 
00143         struct _OISExport Button : Component
00144         {
00145                 Button() {}
00146                 Button(bool bPushed) : Component(OIS_Button), pushed(bPushed) {};
00148                 bool pushed;
00149         };
00150 
00152         struct _OISExport Axis : Component
00153         {
00154                 Axis() : Component(OIS_Axis), abs(0), rel(0), absOnly(false) {};
00155 
00157                 int abs, rel;
00158 
00160                 bool absOnly;
00161 
00163                 void clear()
00164                 {
00165                         abs = rel = 0;
00166                 }
00167         };
00168 }
00169 
00170 #endif //end if prereq header defined

Generated on Sat Dec 1 20:13:51 2007 for OIS by  doxygen 1.5.4