aboutsummaryrefslogtreecommitdiff
path: root/smelt
diff options
context:
space:
mode:
Diffstat (limited to 'smelt')
-rw-r--r--smelt/sdl/inp_sdl.cpp1
-rw-r--r--smelt/sdl/smelt_internal.hpp1
2 files changed, 2 insertions, 0 deletions
diff --git a/smelt/sdl/inp_sdl.cpp b/smelt/sdl/inp_sdl.cpp
index c1e05de..d1d335f 100644
--- a/smelt/sdl/inp_sdl.cpp
+++ b/smelt/sdl/inp_sdl.cpp
@@ -22,6 +22,7 @@ bool SMELT_IMPL::smGetInpEvent(smInpEvent *e)
}
void SMELT_IMPL::smGetMouse2f(float *x,float *y){*x=posx,*y=posy;}
void SMELT_IMPL::smSetMouse2f(float x,float y){SDL_WarpMouseInWindow((SDL_Window*)hwnd,x,y);}
+void SMELT_IMPL::smSetMouseGrab(bool enabled){SDL_SetRelativeMouseMode((SDL_bool)(enabled?1:0));}
int SMELT_IMPL::smGetWheel(){return posz;}
bool SMELT_IMPL::smIsMouseOver(){return mouseOver;}
int SMELT_IMPL::smGetKey(){return lkey;}
diff --git a/smelt/sdl/smelt_internal.hpp b/smelt/sdl/smelt_internal.hpp
index 6d9e04f..b786ee6 100644
--- a/smelt/sdl/smelt_internal.hpp
+++ b/smelt/sdl/smelt_internal.hpp
@@ -134,6 +134,7 @@ public:
virtual void smGetMouse2f(float *x,float *y);
virtual void smSetMouse2f(float x,float y);
+ virtual void smSetMouseGrab(bool enabled);
virtual int smGetWheel();
virtual bool smIsMouseOver();
virtual int smGetKeyState(int key);