21 #include "../../SDL_internal.h"
23 #if SDL_VIDEO_DRIVER_WINDOWS
28 #include "../../events/SDL_mouse_c.h"
33 static int rawInputEnableCount = 0;
38 RAWINPUTDEVICE rawMouse = { 0x01, 0x02, 0,
NULL };
41 rawInputEnableCount++;
42 if (rawInputEnableCount > 1) {
46 if (rawInputEnableCount == 0) {
49 rawInputEnableCount--;
50 if (rawInputEnableCount > 0) {
56 rawMouse.dwFlags |= RIDEV_REMOVE;
60 if (RegisterRawInputDevices(&rawMouse, 1,
sizeof(RAWINPUTDEVICE)) ==
FALSE) {
73 WIN_CreateDefaultCursor()
92 const size_t pad = (
sizeof (
size_t) * 8);
104 bmh.bV4Size =
sizeof(bmh);
108 bmh.bV4BitCount = 32;
110 bmh.bV4AlphaMask = 0xFF000000;
111 bmh.bV4RedMask = 0x00FF0000;
112 bmh.bV4GreenMask = 0x0000FF00;
113 bmh.bV4BlueMask = 0x000000FF;
117 if (maskbits ==
NULL) {
128 ii.xHotspot = (DWORD)
hot_x;
129 ii.yHotspot = (DWORD)hot_y;
130 ii.hbmColor = CreateDIBSection(hdc, (BITMAPINFO*)&bmh, DIB_RGB_COLORS, &
pixels,
NULL, 0);
131 ii.hbmMask = CreateBitmap(
surface->w,
surface->h, 1, 1, maskbits);
132 ReleaseDC(
NULL, hdc);
139 hicon = CreateIconIndirect(&ii);
141 DeleteObject(ii.hbmColor);
142 DeleteObject(ii.hbmMask);
230 if (
data->in_title_click ||
data->focus_click_pending) {
236 ClientToScreen(hwnd, &pt);
237 SetCursorPos(pt.x, pt.y);
241 WIN_WarpMouseGlobal(
int x,
int y)
247 SetCursorPos(pt.x, pt.y);
254 return ToggleRawInput(
enabled);
275 WIN_GetGlobalMouseState(
int *
x,
int *
y)
313 if (rawInputEnableCount) {
314 rawInputEnableCount = 1;