My program changes the size of OGRE::RenderWindow at some time and later I want to get the current size of the window. But, when I use getWidth()
or getHeight()
on the window, they return the original size of the window.
Example code:
OGRE::RenderWindow* win;
// ... OGRE is initialized
// Window is drawn 1024x768 using size from ogre.cfg
// ... lots of code ...
// Window size is changed and it works
win->resize(800, 600);
// ... lots of code ...
// Window is still visibly 800x600, but this call
// returns 1024x768 (the original size)
int w = win->getWidth(); // Returns 1024
int h = win->getHeight(); // Returns 768
How to get correct size of the window?