Fix: SDL device can support FPS camera animator again

Also no longer restricting mouse position to 0-windowsize (restriction for other devices got removed earlier)
And adding some commented out lines to Makesfile for easier testing of SDL. We probably should use some parameter which can be passed to Makefiles for that in the future.
Note: This does not fix all cursor troubles for SDL - it still does not support relative rectangle
Bit arguably how to handle setting/getting mouse position for SDL, for example it still doesn't support a reference rectangle.


git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6424 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
cutealien
2022-09-22 21:47:19 +00:00
parent a69969d6f9
commit 1803413b49
4 changed files with 5 additions and 9 deletions

View File

@ -143,6 +143,8 @@ namespace irr
virtual void setPosition(s32 x, s32 y) IRR_OVERRIDE
{
SDL_WarpMouse( x, y );
CursorPos.X = x;
CursorPos.Y = y;
}
//! Returns the current position of the mouse cursor.
@ -172,15 +174,6 @@ namespace irr
{
CursorPos.X = Device->MouseX;
CursorPos.Y = Device->MouseY;
if (CursorPos.X < 0)
CursorPos.X = 0;
if (CursorPos.X > (s32)Device->Width)
CursorPos.X = Device->Width;
if (CursorPos.Y < 0)
CursorPos.Y = 0;
if (CursorPos.Y > (s32)Device->Height)
CursorPos.Y = Device->Height;
}
CIrrDeviceSDL* Device;