Emscripten: disabled relative mouse mode

This commit is contained in:
Sergii Pylypenko
2021-05-01 00:10:46 +03:00
parent 0e420a84a2
commit fcc0d68864

View File

@@ -209,7 +209,7 @@ bool VideoDriver_SDL_Base::CreateMainSurface(uint w, uint h, bool resize)
bool VideoDriver_SDL_Base::ClaimMousePointer()
{
SDL_ShowCursor(0);
#ifdef __EMSCRIPTEN__
#ifdef EMSCRIPTEN_RELATIVE_MOUSE
SDL_SetRelativeMouseMode(SDL_TRUE);
#endif
return true;
@@ -382,7 +382,7 @@ bool VideoDriver_SDL_Base::PollEvent()
switch (ev.type) {
case SDL_MOUSEMOTION:
#ifdef __EMSCRIPTEN__
#ifdef EMSCRIPTEN_RELATIVE_MOUSE
if (_cursor_new_in_window) {
/* The cursor just moved into the window; this means we don't
* know the absolutely position yet to move relative from.