src/joystick/win32/SDL_dxjoystick.c
branchgsoc2008_force_feedback
changeset 2580 64fa227c01ce
parent 2579 bd2a6c70cb29
child 2616 acd5da848404
equal deleted inserted replaced
2579:bd2a6c70cb29 2580:64fa227c01ce
    65 #define AXIS_MAX	32767   /* maximum value for axis coordinate */
    65 #define AXIS_MAX	32767   /* maximum value for axis coordinate */
    66 #define JOY_AXIS_THRESHOLD	(((AXIS_MAX)-(AXIS_MIN))/100)   /* 1% motion */
    66 #define JOY_AXIS_THRESHOLD	(((AXIS_MAX)-(AXIS_MIN))/100)   /* 1% motion */
    67 
    67 
    68 /* external variables referenced. */
    68 /* external variables referenced. */
    69 extern HINSTANCE SDL_Instance;
    69 extern HINSTANCE SDL_Instance;
    70 extern HWND SDL_Window;
    70 extern HWND SDL_HelperWindow;
    71 
    71 
    72 
    72 
    73 /* local variables */
    73 /* local variables */
    74 static LPDIRECTINPUT dinput = NULL;
    74 static LPDIRECTINPUT dinput = NULL;
    75 extern HRESULT(WINAPI * DInputCreate) (HINSTANCE hinst, DWORD dwVersion,
    75 extern HRESULT(WINAPI * DInputCreate) (HINSTANCE hinst, DWORD dwVersion,
   248 
   248 
   249     /* Aquire shared access. Exclusive access is required for forces,
   249     /* Aquire shared access. Exclusive access is required for forces,
   250      * though. */
   250      * though. */
   251     result =
   251     result =
   252         IDirectInputDevice2_SetCooperativeLevel(joystick->hwdata->
   252         IDirectInputDevice2_SetCooperativeLevel(joystick->hwdata->
   253                                                 InputDevice, SDL_Window,
   253                                                 InputDevice, SDL_HelperWindow,
   254                                                 DISCL_EXCLUSIVE |
   254                                                 DISCL_EXCLUSIVE |
   255                                                 DISCL_BACKGROUND);
   255                                                 DISCL_BACKGROUND);
   256     if (FAILED(result)) {
   256     if (FAILED(result)) {
   257         SetDIerror("IDirectInputDevice2::SetCooperativeLevel", result);
   257         SetDIerror("IDirectInputDevice2::SetCooperativeLevel", result);
   258         return (-1);
   258         return (-1);