[Ohrrpgce] SVN: teeemcee/8115 gfx_directx: Mouse2::setPosition() and updatePosition() now handle any w

subversion at HamsterRepublic.com subversion at HamsterRepublic.com
Wed Aug 24 10:23:03 PDT 2016


teeemcee
2016-08-24 10:23:03 -0700 (Wed, 24 Aug 2016)
913
gfx_directx: Mouse2::setPosition() and updatePosition() now handle any way the display could be stretched

Previously, stretching the window with or without aspect preservation,
maximising the window, or setting the zoom to 1x would all cause a call to
setmouse to not necessarily result in the same coord to be reported by getmouse.
In particular, when there are black bars around the edges, the position was
completely wrong.

This rewrite also updates these functions to not assume 320x200.

Note that if the mouse cursor is on the client area (in the window) but outside
the image rect, the reported position is updated, but clamped to within 320x200,
which is a bit inconsistent, but I'll fix that separately.

However, the translation to screen positions by mouse clipping is still wrong.
Also, setPosition() still doesn't truly move the mouse; it'll jump back
to original position when the user touches it.
---
U   wip/gfx_directx/d3d.cpp
U   wip/gfx_directx/d3d.h
U   wip/gfx_directx/gfx_directx.cpp
U   wip/gfx_directx/mouse.cpp
U   wip/gfx_directx/mouse.h
U   wip/gfx_directx/window.cpp
U   wip/whatsnew.txt


More information about the Ohrrpgce mailing list