I'm trying to make my game window resizable, but resizing the screen seems to screw up my controls and the screen will rotate non-stop.
I found the problem was that the mouse position relative for checking if you moved your mouse (And the distance moved) wasn't updating to the new window .5,.5 (In the middle of the screen)
So the middle would appear to be where the middle was BEFORE resizing the screen.
So I'm taking on the encounter of doing
Code: Select all
core::rect<int> windowSize = core::rect<int>(0,0,screen.width,screen.height);
device->getCursorControl()->setReferenceRect(&windowSize);So my problem is trying to do this:
Code: Select all
core::rect<int> windowSize = core::rect<int>(screen.x,screen.y,screen.x+screen.width,screen.y+screen.height);What I Tried:
Code: Select all
HWND hVWnd = FindWindow((char*)screen.caption.c_str(), (char*)screen.caption.c_str());
RECT rRect;
GetWindowRect(hVWnd,&rRect);
screen.x = rRect.left; screen.y = rRect.top;So how can I get the window's x/y coordinates?
Thanks in advance!