mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-18 06:55:48 +03:00
Retrieve the initial mouse coordinates on SDL2 backend ( since SDL2 does not provided the real coordinates until the mouse is moved ).
--HG-- branch : dev
This commit is contained in:
@@ -329,12 +329,16 @@ void InputSDL::init() {
|
||||
SDL_GetWindowSize(sdlw, &scaledX, &scaledY);
|
||||
mDPIScale = (Float)realX / (Float)scaledX;
|
||||
|
||||
Vector2if mTempMouse;
|
||||
Vector2i mTempMouse;
|
||||
Vector2i mTempWinPos;
|
||||
Recti mBordersSize;
|
||||
|
||||
SDL_GetMouseState( &mTempMouse.x, &mTempMouse.y );
|
||||
SDL_GetGlobalMouseState( &mTempMouse.x, &mTempMouse.y );
|
||||
SDL_GetWindowPosition( sdlw, &mTempWinPos.x, &mTempWinPos.y );
|
||||
SDL_GetWindowBordersSize( sdlw, &mBordersSize.Top, &mBordersSize.Left, &mBordersSize.Bottom, &mBordersSize.Right );
|
||||
|
||||
mMousePos.x = (int)mTempMouse.x;
|
||||
mMousePos.y = (int)mTempMouse.y;
|
||||
mMousePos.x = (int)mTempMouse.x - mTempWinPos.x - mBordersSize.Left;
|
||||
mMousePos.y = (int)mTempMouse.y - mTempWinPos.y - mBordersSize.Top;
|
||||
|
||||
initializeTables();
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ void videoResize( EE::Window::Window * w ) {
|
||||
BlendMode::setMode( ALPHA_BLENDONE );
|
||||
|
||||
/// Set the line width
|
||||
GlobalBatchRenderer::instance()->setLineWidth( 2 );
|
||||
GLi->lineWidth( 2 );
|
||||
|
||||
if ( ShadersSupported ) {
|
||||
/// Rebind the Shader
|
||||
|
||||
Reference in New Issue
Block a user