瀏覽代碼

Fix mouse grabbing and enable it in windowed mode

Thomas Buck 11 年之前
父節點
當前提交
5fe5cbd846
共有 1 個檔案被更改,包括 3 行新增1 行删除
  1. 3
    1
      src/SDLSystem.cpp

+ 3
- 1
src/SDLSystem.cpp 查看文件

@@ -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…
取消
儲存