You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
520 B
32 lines
520 B
#include "devilution.h" |
|
#include "miniwin/ddraw.h" |
|
#include "stubs.h" |
|
#include <SDL.h> |
|
|
|
namespace dvl { |
|
|
|
WINBOOL SetCursorPos(int X, int Y) |
|
{ |
|
assert(window); |
|
|
|
#ifndef USE_SDL1 |
|
if (renderer) { |
|
SDL_Rect view; |
|
SDL_RenderGetViewport(renderer, &view); |
|
X += view.x; |
|
Y += view.y; |
|
|
|
float scaleX; |
|
SDL_RenderGetScale(renderer, &scaleX, NULL); |
|
X *= scaleX; |
|
Y *= scaleX; |
|
} |
|
#endif |
|
|
|
SDL_WarpMouseInWindow(window, X, Y); |
|
MouseX = X; |
|
MouseY = Y; |
|
return true; |
|
} |
|
|
|
} // namespace dvl
|
|
|