diff options
author | endolf <[email protected]> | 2005-08-27 08:22:19 +0000 |
---|---|---|
committer | endolf <[email protected]> | 2005-08-27 08:22:19 +0000 |
commit | 6f2199758a6b0c008f2ea35a73ce516fff1409a5 (patch) | |
tree | 8969f14431d2e81e1c79390ada78ca9962697db7 /plugins/DX8 | |
parent | 5a9dec8a916fc9d5e2d61c512904d24b6af0f307 (diff) |
Start of some work to print more debug if force feedback effect creation fails
git-svn-id: file:///home/sven/projects/JOGL/git-svn/svn-server-sync/jinput/trunk@110 e343933a-64c8-49c5-92b1-88f2ce3e89e8
Diffstat (limited to 'plugins/DX8')
-rw-r--r-- | plugins/DX8/src/native/input.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/plugins/DX8/src/native/input.cpp b/plugins/DX8/src/native/input.cpp index 5fd4bcb..1468904 100644 --- a/plugins/DX8/src/native/input.cpp +++ b/plugins/DX8/src/native/input.cpp @@ -320,6 +320,13 @@ BOOL RegisterDummyWindow(HINSTANCE hInstance) return RegisterClassEx(&wcex); } +// Callback for finding out what effects a device supports +BOOL CALLBACK DIEnumEffectsProc(LPCDIEFFECTINFO pei, LPVOID pv) +{ + *((GUID *)pv) = pei->guid; + return DIENUM_STOP; // one is enough +} + /* * Class: org_java_games_input_DirectInputEnvironmentPlugin * Method: directInputCreate @@ -660,6 +667,19 @@ BOOL CALLBACK EnumObjectsCallback(LPCDIDEVICEOBJECTINSTANCE lpddoi, name); if(ffEnabled) { + + HRESULT hr; + GUID guidEffect; + hr = lpDevice->EnumEffects( + (LPDIENUMEFFECTSCALLBACK) DIEnumEffectsProc, + &guidEffect, + DIEFT_PERIODIC); + if (FAILED(hr)) + { + // Note that success does not mean that any effects were found, + // only that the process went smoothly. + } + // This application needs only one effect: Applying raw forces. DWORD rgdwAxes; LONG rglDirection = 0; |