skip duplicate mousemode changes

This commit is contained in:
oy 2015-10-23 10:06:14 +02:00
parent 7a5285cff0
commit 482f5066b8

View file

@ -67,18 +67,24 @@ void CInput::MouseRelative(float *x, float *y)
} }
void CInput::MouseModeAbsolute() void CInput::MouseModeAbsolute()
{
if(m_InputGrabbed)
{ {
m_InputGrabbed = 0; m_InputGrabbed = 0;
SDL_ShowCursor(SDL_ENABLE); SDL_ShowCursor(SDL_ENABLE);
SDL_SetRelativeMouseMode(SDL_FALSE); SDL_SetRelativeMouseMode(SDL_FALSE);
} }
}
void CInput::MouseModeRelative() void CInput::MouseModeRelative()
{
if(!m_InputGrabbed)
{ {
m_InputGrabbed = 1; m_InputGrabbed = 1;
SDL_ShowCursor(SDL_DISABLE); SDL_ShowCursor(SDL_DISABLE);
SDL_SetRelativeMouseMode(SDL_TRUE); SDL_SetRelativeMouseMode(SDL_TRUE);
} }
}
int CInput::MouseDoubleClick() int CInput::MouseDoubleClick()
{ {