소스 검색

Engine SDL: Use screen space coordinates for both mouse pointer set and get position

Changed mouse pointer coordinates from client to screen space. Done in order to be consistent with existing engine comments, API help doc string, and how it used to work in Win32 window management code.
dottools 3 년 전
부모
커밋
0f81ececae
1개의 변경된 파일2개의 추가작업 그리고 7개의 파일을 삭제
  1. 2 7
      Engine/source/windowManager/sdl/sdlCursorController.cpp

+ 2 - 7
Engine/source/windowManager/sdl/sdlCursorController.cpp

@@ -64,17 +64,12 @@ S32 PlatformCursorControllerSDL::getDoubleClickHeight()
 
 void PlatformCursorControllerSDL::setCursorPosition( S32 x, S32 y )
 {
-   if( PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow() )
-   {
-      AssertFatal( dynamic_cast<PlatformWindowSDL*>( PlatformWindowManager::get()->getFirstWindow() ), "");
-      PlatformWindowSDL *window = static_cast<PlatformWindowSDL*>( PlatformWindowManager::get()->getFirstWindow() );
-      SDL_WarpMouseInWindow(window->getSDLWindow(), x, y);
-   }
+   SDL_WarpMouseGlobal(x, y);
 }
 
 void PlatformCursorControllerSDL::getCursorPosition( Point2I &point )
 {
-   SDL_GetMouseState( &point.x, &point.y );
+   SDL_GetGlobalMouseState( &point.x, &point.y );
 }
 
 void PlatformCursorControllerSDL::setCursorVisible( bool visible )