I have a problem with aspect ratio when using a custom created window instead of the automatically generated window. What I do is let OGRE create the automatic window with some boring settings, no fullscreen, etc. Then I immediately setHidden(true) on it and Ogre::WindowEventUtilities::messagePump().
Then, I grab the render system and call _createRenderWindow as follows
- Code: Select all
params["FSAA"] = "0";
params["FSAAHint"] = "";
params["vsyncInterval"] = "";
params["vsync"] = use_vsync?"true":"false";
params["gamma"] = use_hwgamma?"true":"false";
params["useNVPerfHUD"] = "true";
Ogre::RenderWindow *win = rs->_createRenderWindow("Grit Game Window", 800, 600, use_fullscreen, ¶ms);
I store the win pointer somewhere and in the rest of the code I use that instead of root->getAutoCreatedWindow().
What I find is that the first window appears and then disappears, and following that the real window appears. Everything is rendering into it fine but the aspect ratio is wrong. If I resize the window it will be fixed for the lifetime of the program, it is just this first display that is wrong.