@ -332,9 +332,9 @@ static int defaultKeyboardMode; // Used to store default keyboar
# endif
/ / Mouse states
static Vector2 mousePosition ; / / Mouse position on screen
static Vector2 mouseScale = { 1.0f , 1.0f } ; / / Mouse k">default scale
static Vector2 mouseOffset = { 0.0f , 0.0f } ; / / Mouse k">default scal e
static Vector2 mousePosition = { 0.0f , 0.0f } ; / / Mouse position on screen
static Vector2 mouseScale = { 1.0f , 1.0f } ; / / Mouse n">scaling
static Vector2 mouseOffset = { 0.0f , 0.0f } ; / / Mouse off set
static bool cursorHidden = false ; / / Track if cursor is hidden
static bool cursorOnScreen = false ; / / Tracks if cursor is inside client area
static Vector2 touchPosition [ MAX_TOUCH_POINTS ] ; / / Touch position on screen
@ -2076,7 +2076,7 @@ int GetMouseX(void)
# if defined(PLATFORM_ANDROID)
return ( int ) touchPosition [ 0 ] . x ;
# else
return ( int ) ( ( mousePosition . x + mouseOffset . x ) * mouseScale . x ) ;
return ( int ) ( ( mousePosition . x + mouseOffset . x ) * mouseScale . x ) ;
# endif
}
@ -2086,7 +2086,7 @@ int GetMouseY(void)
# if defined(PLATFORM_ANDROID)
return ( int ) touchPosition [ 0 ] . x ;
# else
return ( int ) ( ( mousePosition . y + mouseOffset . y ) * mouseScale . y ) ;
return ( int ) ( ( mousePosition . y + mouseOffset . y ) * mouseScale . y ) ;
# endif
}
@ -2096,36 +2096,32 @@ Vector2 GetMousePosition(void)
# if defined(PLATFORM_ANDROID)
return GetTouchPosition ( 0 ) ;
# else
return ( Vector2 ) { ( mousePosition . x + mouseOffset . x ) * mouseScale . x , ( mousePosition . y + mouseOffset . y ) * mouseScale . y } ;
return ( Vector2 ) { ( mousePosition . x + mouseOffset . x ) * mouseScale . x , ( mousePosition . y + mouseOffset . y ) * mouseScale . y } ;
# endif
}
/ / Set mouse position XY
void SetMousePosition ( n">Vector2 position )
void SetMousePosition ( kt">int x , int y )
{
mousePosition = n">position ;
mousePosition = p">( Vector2 ) { ( float ) x , ( float ) y } ;
# if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
/ / NOTE : emscripten not implemented
glfwSetCursorPos ( window , p osition. x , p osition. y ) ;
glfwSetCursorPos ( window , mouseP osition. x , mouseP osition. y ) ;
# endif
}
/ / Set mouse scaling
/ / Set mouse offset
/ / NOTE : Useful when rendering to different size targets
void SetMouseScale ( Vector2 scale )
void SetMouseOffset ( int offsetX , int offsetY )
{
# if !defined(PLATFORM_ANDROID)
mouseScale = scale ;
# endif
mouseOffset = ( Vector2 ) { ( float ) offsetX , ( float ) offsetY } ;
}
/ / Set mouse offset
/ / Set mouse scaling
/ / NOTE : Useful when rendering to different size targets
void SetMouseOffset ( Vector2 offset )
void SetMouseScale ( float scaleX , float scaleY )
{
# if !defined(PLATFORM_ANDROID)
mouseScale = offset ;
# endif
mouseScale = ( Vector2 ) { scaleX , scaleY } ;
}
/ / Returns mouse wheel movement Y