Selaa lähdekoodia

Fix mouse grabbing and enable it in windowed mode

Thomas Buck 10 vuotta sitten
vanhempi
commit
5fe5cbd846
1 muutettua tiedostoa jossa 3 lisäystä ja 1 poistoa
  1. 3
    1
      src/SDLSystem.cpp

+ 3
- 1
src/SDLSystem.cpp Näytä tiedosto

@@ -251,9 +251,11 @@ void SDLSystem::initVideo(unsigned int width, unsigned int height,
251 251
 	if (mFullscreen)
252 252
 	{
253 253
 		flags |= SDL_FULLSCREEN;
254
-        SDL_ShowCursor(SDL_DISABLE);
255 254
 	}
256 255
 
256
+    SDL_ShowCursor(SDL_DISABLE);
257
+    setGrabMouse(true); // Always grab mouse!
258
+
257 259
 	SDL_GL_SetAttribute(SDL_GL_RED_SIZE, 5);
258 260
 	SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5);
259 261
 	SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5);

Loading…
Peruuta
Tallenna