[fixed]CursorControl bug when resizing window

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
buffer
Posts: 4
Joined: Fri Jun 19, 2009 10:01 pm

[fixed]CursorControl bug when resizing window

Post by buffer »

win32, irrl 1.5.1, d3d9:

CursorControl does not update its internal window size variables when the the window has been resized. This results in incorrect behavior when requesting relative pos etc..

Steps to reproduce:
1) Start in windowed mode (with resize=true)
2) Inspect GetDevice()->getCursorControl()->getRelativePosition() return values
3) Resize window
4) Inspect GetDevice()->getCursorControl()->getRelativePosition() return values again and notice incorrectness.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Yeah, I see the problem, InvWindowSize is not updated, same in WinCE. Easy to fix, but I'm on the wrong system at the moment. I'll try find some time to fix it next days (unless someone does it before me).

Thanks for reporting.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
rvl2
Posts: 6
Joined: Sun Aug 23, 2009 10:43 am

Post by rvl2 »

By the way, in WinCE the GetCursorPos() (used by CursorControl) returns FALSE on some devices (like my Eten Glofish X500 and WM5 SDK simulator). As result the default mouse handling code of camera nodes doesn't work as expected. The code below fixes the problem (CIrrDeviceWinCE.h):

Code: Select all

POINT p;
if (!GetCursorPos(&p))
{
   DWORD xy = GetMessagePos();
   p.x = GET_X_LPARAM(xy);
   p.y = GET_Y_LPARAM(xy);
}
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Both bugs should be fixed now in svn. Thanks also to rvl2, I hope I didn't mess up anything as I have no WinCE system so I always can't test that.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply