- There's really no need anymore to dynamically load RawInput, considering it has been in Windows since XP.
This commit is contained in:
parent
79ad3e6203
commit
293aa2e6da
6 changed files with 45 additions and 270 deletions
|
|
@ -43,7 +43,6 @@
|
|||
#include "d_gui.h"
|
||||
#include "g_game.h"
|
||||
#include "hardware.h"
|
||||
#include "rawinput.h"
|
||||
#include "menu/menu.h"
|
||||
#include "events.h"
|
||||
|
||||
|
|
@ -546,21 +545,17 @@ bool FRawMouse::GetDevice()
|
|||
{
|
||||
RAWINPUTDEVICE rid;
|
||||
|
||||
if (MyRegisterRawInputDevices == NULL)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
rid.usUsagePage = HID_GENERIC_DESKTOP_PAGE;
|
||||
rid.usUsage = HID_GDP_MOUSE;
|
||||
rid.dwFlags = 0;
|
||||
rid.hwndTarget = Window;
|
||||
if (!MyRegisterRawInputDevices(&rid, 1, sizeof(rid)))
|
||||
if (!RegisterRawInputDevices(&rid, 1, sizeof(rid)))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
rid.dwFlags = RIDEV_REMOVE;
|
||||
rid.hwndTarget = NULL; // Must be NULL for RIDEV_REMOVE.
|
||||
MyRegisterRawInputDevices(&rid, 1, sizeof(rid));
|
||||
RegisterRawInputDevices(&rid, 1, sizeof(rid));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -580,7 +575,7 @@ void FRawMouse::Grab()
|
|||
rid.usUsage = HID_GDP_MOUSE;
|
||||
rid.dwFlags = RIDEV_CAPTUREMOUSE | RIDEV_NOLEGACY;
|
||||
rid.hwndTarget = Window;
|
||||
if (MyRegisterRawInputDevices(&rid, 1, sizeof(rid)))
|
||||
if (RegisterRawInputDevices(&rid, 1, sizeof(rid)))
|
||||
{
|
||||
GetCursorPos(&UngrabbedPointerPos);
|
||||
Grabbed = true;
|
||||
|
|
@ -609,7 +604,7 @@ void FRawMouse::Ungrab()
|
|||
rid.usUsage = HID_GDP_MOUSE;
|
||||
rid.dwFlags = RIDEV_REMOVE;
|
||||
rid.hwndTarget = NULL;
|
||||
if (MyRegisterRawInputDevices(&rid, 1, sizeof(rid)))
|
||||
if (RegisterRawInputDevices(&rid, 1, sizeof(rid)))
|
||||
{
|
||||
Grabbed = false;
|
||||
ClearButtonState();
|
||||
|
|
@ -1185,18 +1180,6 @@ void I_StartupMouse ()
|
|||
|
||||
switch(in_mouse)
|
||||
{
|
||||
case 0:
|
||||
default:
|
||||
if (MyRegisterRawInputDevices != NULL)
|
||||
{
|
||||
new_mousemode = MM_RawInput;
|
||||
}
|
||||
else
|
||||
{
|
||||
new_mousemode = MM_DInput;
|
||||
}
|
||||
break;
|
||||
|
||||
case 1:
|
||||
new_mousemode = MM_Win32;
|
||||
break;
|
||||
|
|
@ -1205,6 +1188,7 @@ void I_StartupMouse ()
|
|||
new_mousemode = MM_DInput;
|
||||
break;
|
||||
|
||||
default:
|
||||
case 3:
|
||||
new_mousemode = MM_RawInput;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue