Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: Window dimensions  (Read 560 times)

Miktor

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
Window dimensions
« on: December 28, 2009, 09:00:51 AM »

Hi all!
I new in OIS.
I use Ogre3D and OIS for my program.
I had a few problems with the size of the window in which can move the Mouse.
I read an Tutorial of how you to use OIS and did as it says.
Code: [Select]
void AppInput::WinResized(Ogre::RenderWindow* mWin)
{
unsigned int width, height, depth;
int top, left;
mWin->getMetrics(width, height, depth, left, top);
const OIS::MouseState &ms = mMouse->getMouseState();
ms.width=width;
ms.height = height;
}
This function is called when the initialization OIS and each resizing window.
If you look at the function to watch the values ms.width and ms.height they are correct, but if you look at the function mouseMoved it seemed to me, they do not show the size of the window, they indicate the position of the mouse.
I am in the debugger manually change the values abX and abY at 800 and 600, respectively, and then the Mouse moved as needed, but how to change them "legal" way, I do not know.
Plz help me.
And sry for my English.


Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: Window dimensions
« Reply #1 on: December 28, 2009, 07:11:02 PM »

Width and Height should stay exactly to what you set them to during initialization, and as you update them accordingly when your window resizes.
Logged

Miktor

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
Re: Window dimensions
« Reply #2 on: December 29, 2009, 06:23:44 AM »

I do it.I call my function all time when window resized and when OIS initializited
Logged