Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
fengzch-das
OIS
Commits
d9b8990a
Commit
d9b8990a
authored
Jul 10, 2010
by
Phillip Castaneda
Browse files
Adding XInput support for win32. Not currently an option to compile out - todo.
parent
6a6c0c87
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
557 additions
and
268 deletions
+557
-268
ReadMe.txt
ReadMe.txt
+5
-16
Win32/CommandLine/CommandLine_vc9.vcproj
Win32/CommandLine/CommandLine_vc9.vcproj
+31
-31
Win32/DemoFFTest/DemoFFTest_vc9.vcproj
Win32/DemoFFTest/DemoFFTest_vc9.vcproj
+2
-2
Win32/OIS_vc8.vcproj
Win32/OIS_vc8.vcproj
+8
-8
Win32/OIS_vc9.vcproj
Win32/OIS_vc9.vcproj
+8
-15
includes/win32/Win32JoyStick.h
includes/win32/Win32JoyStick.h
+11
-3
includes/win32/Win32Prereqs.h
includes/win32/Win32Prereqs.h
+5
-1
src/win32/Win32InputManager.cpp
src/win32/Win32InputManager.cpp
+16
-2
src/win32/Win32JoyStick.cpp
src/win32/Win32JoyStick.cpp
+471
-190
No files found.
ReadMe.txt
View file @
d9b8990a
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
The zlib/libpng License
The zlib/libpng License
Copyright (c) 2005-200
7
Phillip Castaneda (pjcast -- www.wreckedgames.com)
Copyright (c) 2005-20
1
0 Phillip Castaneda (pjcast -- www.wreckedgames.com)
This software is provided 'as-is', without any express or implied warranty. In no
This software is provided 'as-is', without any express or implied warranty. In no
event will the authors be held liable for any damages arising from the use of this
event will the authors be held liable for any damages arising from the use of this
...
@@ -45,21 +45,16 @@ compatiable with many systems and operating systems
...
@@ -45,21 +45,16 @@ compatiable with many systems and operating systems
Win32/
Win32/
Contains Visual Studio .Net Solution Files
Contains Visual Studio .Net Solution Files
Contains CodeBlocks
+ MinGW + StlPort
project files for OIS
Contains CodeBlocks project files for OIS
---- Dependencies ------------------------------------------------------
---- Dependencies ------------------------------------------------------
DirectInput 8
DirectInput 8
Ogre & CEGUI 0.4.0 If building CEGUIOgre OIS Demo
SDL/
A test bed for an OIS InputManager with SDL as the backend. Not recommended;
however, useful for platforms with non-native OIS ports for temporary use.
Linux/
Linux/
---- Dependencies ------------------------------------------------------
---- Dependencies ------------------------------------------------------
X11
X11
Ogre (GLX Platform) & CEGUI 0.4.0 If building CEGUIOgre OIS Demo
Newer Linux Kernel (2.6+ ?) for Event API
Newer Linux Kernel (2.6+ ?) for Event API - else, use --disable-joyevents
Steps to build on Linux:
Steps to build on Linux:
./bootstrap
./bootstrap
...
@@ -68,9 +63,7 @@ Linux/
...
@@ -68,9 +63,7 @@ Linux/
---- Configure build options --------------------------------------------
---- Configure build options --------------------------------------------
./configure --help --- List all configure options
./configure --help --- List all configure options
./configure --disable-ogre --- Disables CEGUIOgre ActionMapping Demo
./configure --disable-joyevents --- Uses /dev/input/jsX instead of
/dev/input/eventX
LinuxCB/
LinuxCB/
Contains CodeBlock files for building OIS and Demos with codeblocks
Contains CodeBlock files for building OIS and Demos with codeblocks
...
@@ -79,9 +72,5 @@ LinuxCB/
...
@@ -79,9 +72,5 @@ LinuxCB/
settings. It also installs libOIS to ~/libs
settings. It also installs libOIS to ~/libs
Mac/
Mac/
XCode-1.5/
Non-complete native OIS port.
XCode-2.2/
XCode-2.2/
Working, complete, OIS port to OSX using SDL as a backend.
Working, mostly complete OSX vackend.
\ No newline at end of file
\ No newline at end of file
Win32/CommandLine/CommandLine_vc9.vcproj
View file @
d9b8990a
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"ois_static_d.lib"
AdditionalDependencies=
"ois_static_d.lib
xinput.lib
"
OutputFile=
"$(OutDir)/CommandLine.exe"
OutputFile=
"$(OutDir)/CommandLine.exe"
LinkIncremental=
"2"
LinkIncremental=
"2"
AdditionalLibraryDirectories=
"..\..\lib;..\..\src\win32\extras\WiiMote"
AdditionalLibraryDirectories=
"..\..\lib;..\..\src\win32\extras\WiiMote"
...
@@ -99,9 +99,9 @@
...
@@ -99,9 +99,9 @@
/>
/>
</Configuration>
</Configuration>
<Configuration
<Configuration
Name=
"
Debug|x64
"
Name=
"
Release|Win32
"
OutputDirectory=
"
$(PlatformName)\$(ConfigurationName)
"
OutputDirectory=
"
Release
"
IntermediateDirectory=
"
$(PlatformName)\$(ConfigurationName)
"
IntermediateDirectory=
"
Release
"
ConfigurationType=
"1"
ConfigurationType=
"1"
CharacterSet=
"2"
CharacterSet=
"2"
>
>
...
@@ -119,16 +119,17 @@
...
@@ -119,16 +119,17 @@
/>
/>
<Tool
<Tool
Name=
"VCMIDLTool"
Name=
"VCMIDLTool"
TargetEnvironment=
"3"
/>
/>
<Tool
<Tool
Name=
"VCCLCompilerTool"
Name=
"VCCLCompilerTool"
Optimization=
"0"
Optimization=
"2"
InlineFunctionExpansion=
"1"
OmitFramePointers=
"true"
AdditionalIncludeDirectories=
"..\..\includes;..\CommandLine\"
AdditionalIncludeDirectories=
"..\..\includes;..\CommandLine\"
PreprocessorDefinitions=
"WIN32;
_
DEBUG;_CONSOLE
;_STLP_DEBUG
"
PreprocessorDefinitions=
"WIN32;
N
DEBUG;_CONSOLE"
MinimalRebuild
=
"true"
StringPooling
=
"true"
Basic
Runtime
Checks
=
"
3
"
Runtime
Library
=
"
2
"
R
unti
meLibrary=
"3
"
EnableF
un
c
ti
onLevelLinking=
"true
"
UsePrecompiledHeader=
"0"
UsePrecompiledHeader=
"0"
WarningLevel=
"3"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"true"
Detect64BitPortabilityProblems=
"true"
...
@@ -145,16 +146,17 @@
...
@@ -145,16 +146,17 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"ois_
d
.lib"
AdditionalDependencies=
"ois_
static.lib xinput
.lib"
OutputFile=
"$(OutDir)/CommandLine.exe"
OutputFile=
"$(OutDir)/CommandLine.exe"
LinkIncremental=
"
2
"
LinkIncremental=
"
1
"
AdditionalLibraryDirectories=
"..\..\lib
64
"
AdditionalLibraryDirectories=
"..\..\lib
;..\..\src\win32\extras\WiiMote
"
GenerateDebugInformation=
"true"
GenerateDebugInformation=
"true"
ProgramDatabaseFile=
"$(OutDir)/CommandLine.pdb"
SubSystem=
"1"
SubSystem=
"1"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
RandomizedBaseAddress=
"1"
RandomizedBaseAddress=
"1"
DataExecutionPrevention=
"0"
DataExecutionPrevention=
"0"
TargetMachine=
"1
7
"
TargetMachine=
"1"
/>
/>
<Tool
<Tool
Name=
"VCALinkTool"
Name=
"VCALinkTool"
...
@@ -180,9 +182,9 @@
...
@@ -180,9 +182,9 @@
/>
/>
</Configuration>
</Configuration>
<Configuration
<Configuration
Name=
"
Release|Win32
"
Name=
"
Debug|x64
"
OutputDirectory=
"
Release
"
OutputDirectory=
"
$(PlatformName)\$(ConfigurationName)
"
IntermediateDirectory=
"
Release
"
IntermediateDirectory=
"
$(PlatformName)\$(ConfigurationName)
"
ConfigurationType=
"1"
ConfigurationType=
"1"
CharacterSet=
"2"
CharacterSet=
"2"
>
>
...
@@ -200,17 +202,16 @@
...
@@ -200,17 +202,16 @@
/>
/>
<Tool
<Tool
Name=
"VCMIDLTool"
Name=
"VCMIDLTool"
TargetEnvironment=
"3"
/>
/>
<Tool
<Tool
Name=
"VCCLCompilerTool"
Name=
"VCCLCompilerTool"
Optimization=
"2"
Optimization=
"0"
InlineFunctionExpansion=
"1"
OmitFramePointers=
"true"
AdditionalIncludeDirectories=
"..\..\includes;..\CommandLine\"
AdditionalIncludeDirectories=
"..\..\includes;..\CommandLine\"
PreprocessorDefinitions=
"WIN32;
N
DEBUG;_CONSOLE"
PreprocessorDefinitions=
"WIN32;
_
DEBUG;_CONSOLE
;_STLP_DEBUG
"
StringPooling
=
"true"
MinimalRebuild
=
"true"
Runtime
Library
=
"
2
"
Basic
Runtime
Checks
=
"
3
"
EnableF
un
c
ti
onLevelLinking=
"true
"
R
unti
meLibrary=
"3
"
UsePrecompiledHeader=
"0"
UsePrecompiledHeader=
"0"
WarningLevel=
"3"
WarningLevel=
"3"
Detect64BitPortabilityProblems=
"true"
Detect64BitPortabilityProblems=
"true"
...
@@ -227,17 +228,16 @@
...
@@ -227,17 +228,16 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"ois_
static
.lib"
AdditionalDependencies=
"ois_
d
.lib"
OutputFile=
"$(OutDir)/CommandLine.exe"
OutputFile=
"$(OutDir)/CommandLine.exe"
LinkIncremental=
"
1
"
LinkIncremental=
"
2
"
AdditionalLibraryDirectories=
"..\..\lib
;..\..\src\win32\extras\WiiMote
"
AdditionalLibraryDirectories=
"..\..\lib
64
"
GenerateDebugInformation=
"true"
GenerateDebugInformation=
"true"
ProgramDatabaseFile=
"$(OutDir)/CommandLine.pdb"
SubSystem=
"1"
SubSystem=
"1"
OptimizeReferences=
"2"
EnableCOMDATFolding=
"2"
RandomizedBaseAddress=
"1"
RandomizedBaseAddress=
"1"
DataExecutionPrevention=
"0"
DataExecutionPrevention=
"0"
TargetMachine=
"1"
TargetMachine=
"1
7
"
/>
/>
<Tool
<Tool
Name=
"VCALinkTool"
Name=
"VCALinkTool"
...
...
Win32/DemoFFTest/DemoFFTest_vc9.vcproj
View file @
d9b8990a
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"ois_static_d.lib"
AdditionalDependencies=
"ois_static_d.lib
xinput.lib
"
OutputFile=
"$(OutDir)/DemoFFTest.exe"
OutputFile=
"$(OutDir)/DemoFFTest.exe"
LinkIncremental=
"2"
LinkIncremental=
"2"
AdditionalLibraryDirectories=
"..\..\lib;..\..\src\win32\extras\WiiMote"
AdditionalLibraryDirectories=
"..\..\lib;..\..\src\win32\extras\WiiMote"
...
@@ -146,7 +146,7 @@
...
@@ -146,7 +146,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"ois_static.lib"
AdditionalDependencies=
"ois_static.lib
xinput.lib
"
OutputFile=
"$(OutDir)/DemoFFTest.exe"
OutputFile=
"$(OutDir)/DemoFFTest.exe"
LinkIncremental=
"1"
LinkIncremental=
"1"
AdditionalLibraryDirectories=
"..\..\lib;..\..\src\win32\extras\WiiMote"
AdditionalLibraryDirectories=
"..\..\lib;..\..\src\win32\extras\WiiMote"
...
...
Win32/OIS_vc8.vcproj
View file @
d9b8990a
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLibrarianTool"
Name=
"VCLibrarianTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS_static_d.lib"
OutputFile=
"$(OutDir)/OIS_static_d.lib"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote"
/>
/>
...
@@ -140,7 +140,7 @@
...
@@ -140,7 +140,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLibrarianTool"
Name=
"VCLibrarianTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS_d.lib"
OutputFile=
"$(OutDir)/OIS_d.lib"
/>
/>
<Tool
<Tool
...
@@ -212,7 +212,7 @@
...
@@ -212,7 +212,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLibrarianTool"
Name=
"VCLibrarianTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS_static.lib"
OutputFile=
"$(OutDir)/OIS_static.lib"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote"
/>
/>
...
@@ -289,7 +289,7 @@
...
@@ -289,7 +289,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLibrarianTool"
Name=
"VCLibrarianTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS.lib"
OutputFile=
"$(OutDir)/OIS.lib"
/>
/>
<Tool
<Tool
...
@@ -361,7 +361,7 @@
...
@@ -361,7 +361,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote\"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote\"
GenerateDebugInformation=
"false"
GenerateDebugInformation=
"false"
OptimizeReferences=
"2"
OptimizeReferences=
"2"
...
@@ -451,7 +451,7 @@
...
@@ -451,7 +451,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
GenerateDebugInformation=
"true"
GenerateDebugInformation=
"true"
TargetMachine=
"17"
TargetMachine=
"17"
/>
/>
...
@@ -531,7 +531,7 @@
...
@@ -531,7 +531,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS_d.dll"
OutputFile=
"$(OutDir)/OIS_d.dll"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote\"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote\"
GenerateDebugInformation=
"true"
GenerateDebugInformation=
"true"
...
@@ -613,7 +613,7 @@
...
@@ -613,7 +613,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS_d.dll"
OutputFile=
"$(OutDir)/OIS_d.dll"
TargetMachine=
"17"
TargetMachine=
"17"
/>
/>
...
...
Win32/OIS_vc9.vcproj
View file @
d9b8990a
...
@@ -69,7 +69,7 @@
...
@@ -69,7 +69,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLibrarianTool"
Name=
"VCLibrarianTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS_static_d.lib"
OutputFile=
"$(OutDir)/OIS_static_d.lib"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote"
/>
/>
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLibrarianTool"
Name=
"VCLibrarianTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS_static.lib"
OutputFile=
"$(OutDir)/OIS_static.lib"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote"
/>
/>
...
@@ -215,7 +215,7 @@
...
@@ -215,7 +215,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote\"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote\"
GenerateDebugInformation=
"false"
GenerateDebugInformation=
"false"
OptimizeReferences=
"2"
OptimizeReferences=
"2"
...
@@ -298,7 +298,7 @@
...
@@ -298,7 +298,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS_d.dll"
OutputFile=
"$(OutDir)/OIS_d.dll"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote\"
AdditionalLibraryDirectories=
"..\src\win32\extras\WiiMote\"
GenerateDebugInformation=
"true"
GenerateDebugInformation=
"true"
...
@@ -379,7 +379,7 @@
...
@@ -379,7 +379,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLibrarianTool"
Name=
"VCLibrarianTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS_d.lib"
OutputFile=
"$(OutDir)/OIS_d.lib"
/>
/>
<Tool
<Tool
...
@@ -455,7 +455,7 @@
...
@@ -455,7 +455,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLibrarianTool"
Name=
"VCLibrarianTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS.lib"
OutputFile=
"$(OutDir)/OIS.lib"
/>
/>
<Tool
<Tool
...
@@ -531,7 +531,7 @@
...
@@ -531,7 +531,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
GenerateDebugInformation=
"true"
GenerateDebugInformation=
"true"
RandomizedBaseAddress=
"1"
RandomizedBaseAddress=
"1"
DataExecutionPrevention=
"0"
DataExecutionPrevention=
"0"
...
@@ -611,7 +611,7 @@
...
@@ -611,7 +611,7 @@
/>
/>
<Tool
<Tool
Name=
"VCLinkerTool"
Name=
"VCLinkerTool"
AdditionalDependencies=
"dxguid.lib dinput8.lib"
AdditionalDependencies=
"dxguid.lib dinput8.lib
xinput.lib
"
OutputFile=
"$(OutDir)/OIS_d.dll"
OutputFile=
"$(OutDir)/OIS_d.dll"
RandomizedBaseAddress=
"1"
RandomizedBaseAddress=
"1"
DataExecutionPrevention=
"0"
DataExecutionPrevention=
"0"
...
@@ -897,13 +897,6 @@
...
@@ -897,13 +897,6 @@
Name=
"VCResourceCompilerTool"
Name=
"VCResourceCompilerTool"
/>
/>
</FileConfiguration>
</FileConfiguration>
<FileConfiguration
Name=
"OIS_ReleaseDll|Win32"
>
<Tool
Name=
"VCResourceCompilerTool"
/>
</FileConfiguration>
<FileConfiguration
<FileConfiguration
Name=
"OIS_DebugDll|Win32"
Name=
"OIS_DebugDll|Win32"
ExcludedFromBuild=
"true"
ExcludedFromBuild=
"true"
...
...
includes/win32/Win32JoyStick.h
View file @
d9b8990a
...
@@ -46,6 +46,14 @@ namespace OIS
...
@@ -46,6 +46,14 @@ namespace OIS
/** @copydoc Object::_initialize */
/** @copydoc Object::_initialize */
virtual
void
_initialize
();
virtual
void
_initialize
();
/**
@remarks
Enum each PNP device using WMI and check each device ID to see if it contains
"IG_" (ex. "VID_045E&PID_028E&IG_00"). If it does, then it's an XInput device
Unfortunately this information can not be found by just using DirectInput
*/
static
void
CheckXInputDevices
(
JoyStickInfoList
&
joys
);
protected:
protected:
//! Enumerates all things
//! Enumerates all things
void
_enumerate
();
void
_enumerate
();
...
@@ -60,12 +68,12 @@ namespace OIS
...
@@ -60,12 +68,12 @@ namespace OIS
IDirectInput8
*
mDirectInput
;
IDirectInput8
*
mDirectInput
;
IDirectInputDevice8
*
mJoyStick
;
IDirectInputDevice8
*
mJoyStick
;
DIDEVCAPS
mDIJoyCaps
;
DIDEVCAPS
mDIJoyCaps
;
DWORD
coopSetting
;
DWORD
coopSetting
;
GUID
deviceGuid
;
JoyStickInfo
mJoyInfo
;
//! A force feedback device
//! A force feedback device
Win32ForceFeedback
*
ff_d
evice
;
Win32ForceFeedback
*
mFfD
evice
;
//! Mapping
//! Mapping
int
_AxisNumber
;
int
_AxisNumber
;
...
...
includes/win32/Win32Prereqs.h
View file @
d9b8990a
...
@@ -27,6 +27,7 @@ restrictions:
...
@@ -27,6 +27,7 @@ restrictions:
#define DIRECTINPUT_VERSION 0x0800
#define DIRECTINPUT_VERSION 0x0800
#include <windows.h>
#include <windows.h>
#include <dinput.h>
#include <dinput.h>
#include <XInput.h>
//Max number of elements to collect from buffered DirectInput
//Max number of elements to collect from buffered DirectInput
#define KEYBOARD_DX_BUFFERSIZE 17
#define KEYBOARD_DX_BUFFERSIZE 17
...
@@ -54,10 +55,13 @@ namespace OIS
...
@@ -54,10 +55,13 @@ namespace OIS
public:
public:
int
devId
;
int
devId
;
GUID
deviceID
;
GUID
deviceID
;
GUID
productGuid
;
std
::
string
vendor
;
std
::
string
vendor
;
bool
isXInput
;
int
xInputDev
;
};
};
typedef
std
::
vector
<
JoyStickInfo
>
JoyStickInfoList
;
typedef
std
::
vector
<
JoyStickInfo
>
JoyStickInfoList
;
}
}
#endif //_WIN32_INPUTSYSTEM_PREREQS_H
#endif //_WIN32_INPUTSYSTEM_PREREQS_H
src/win32/Win32InputManager.cpp
View file @
d9b8990a
...
@@ -74,7 +74,7 @@ void Win32InputManager::_initialize( ParamList ¶mList )
...
@@ -74,7 +74,7 @@ void Win32InputManager::_initialize( ParamList ¶mList )
hInst
=
GetModuleHandle
(
0
);
hInst
=
GetModuleHandle
(
0
);
//Create the
input system
//Create the
device
hr
=
DirectInput8Create
(
hInst
,
DIRECTINPUT_VERSION
,
IID_IDirectInput8
,
(
VOID
**
)
&
mDirectInput
,
NULL
);
hr
=
DirectInput8Create
(
hInst
,
DIRECTINPUT_VERSION
,
IID_IDirectInput8
,
(
VOID
**
)
&
mDirectInput
,
NULL
);
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
OIS_EXCEPT
(
E_General
,
"Win32InputManager::Win32InputManager >> Not able to init DirectX8 Input!"
);
OIS_EXCEPT
(
E_General
,
"Win32InputManager::Win32InputManager >> Not able to init DirectX8 Input!"
);
...
@@ -117,7 +117,19 @@ void Win32InputManager::_parseConfigSettings( ParamList ¶mList )
...
@@ -117,7 +117,19 @@ void Win32InputManager::_parseConfigSettings( ParamList ¶mList )
void
Win32InputManager
::
_enumerateDevices
()
void
Win32InputManager
::
_enumerateDevices
()
{
{
//Enumerate all attached devices
//Enumerate all attached devices
mDirectInput
->
EnumDevices
(
NULL
,
_DIEnumDevCallback
,
this
,
DIEDFL_ATTACHEDONLY
);
mDirectInput
->
EnumDevices
(
NULL
,
_DIEnumDevCallback
,
this
,
DIEDFL_ATTACHEDONLY
);
int
xinputControllers
=
0
;
//let's check how many possible XInput devices we may have (max 4)...
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
XINPUT_STATE
state
;
if
(
XInputGetState
(
i
,
&
state
)
!=
ERROR_DEVICE_NOT_CONNECTED
)
{
//Once we found 1, just check our whole list against devices
Win32JoyStick
::
CheckXInputDevices
(
unusedJoyStickList
);
break
;
}
}
}
}
//--------------------------------------------------------------------------------//
//--------------------------------------------------------------------------------//
...
@@ -133,6 +145,8 @@ BOOL CALLBACK Win32InputManager::_DIEnumDevCallback(LPCDIDEVICEINSTANCE lpddi, L
...
@@ -133,6 +145,8 @@ BOOL CALLBACK Win32InputManager::_DIEnumDevCallback(LPCDIDEVICEINSTANCE lpddi, L
GET_DIDEVICE_TYPE
(
lpddi
->
dwDevType
)
==
DI8DEVTYPE_FLIGHT
)
GET_DIDEVICE_TYPE
(
lpddi
->
dwDevType
)
==
DI8DEVTYPE_FLIGHT
)
{
{
JoyStickInfo
jsInfo
;
JoyStickInfo
jsInfo
;
jsInfo
.
isXInput
=
false
;
jsInfo
.
productGuid
=
lpddi
->
guidProduct
;
jsInfo
.
deviceID
=
lpddi
->
guidInstance
;
jsInfo
.
deviceID
=
lpddi
->
guidInstance
;
jsInfo
.
vendor
=
lpddi
->
tszInstanceName
;
jsInfo
.
vendor
=
lpddi
->
tszInstanceName
;
jsInfo
.
devId
=
_this_
->
joySticks
;
jsInfo
.
devId
=
_this_
->
joySticks
;
...
...
src/win32/Win32JoyStick.cpp
View file @
d9b8990a
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment