I've been banging my head on the keyboard almost all day with this issue, and have tried searching the forums / wiki / other resources to figure out what could be going on with no answers. Basically, the application runs fine (main loop is running, I can see the scene being drawn, etc.), but the window is not responsive, it shows the waiting cursor, and if I minimize it, I can't alt+tab back to it.
I've tried using Root->StartRendering() and using my own loop and calling Ogre::WindowEventUtilities::messagePump() manually, but both present the same issue. Here's some code with what I'm doing to init Ogre:
Code: Select all
mResourcePath = resourcePath;
mRoot = new Ogre::Root(resourcePath + "/plugins.cfg",
resourcePath + "/ogre.cfg",
resourcePath + "/ogre.log");
if (!mRoot->showConfigDialog()) {
return false;
}
// Window
mWindow = mRoot->initialise(true);
mSceneMgr = mRoot->createSceneManager(Ogre::ST_GENERIC,
"Main Scene Manager");
// Camera
mCam = mSceneMgr->createCamera("Main Camera");
mCam->setPosition(Ogre::Vector3(0, 0, 80));
mCam->lookAt(Ogre::Vector3(0, 0, -300));
mCam->setNearClipDistance(5);
// Viewport
mViewport = mWindow->addViewport(mCam);
mViewport->setBackgroundColour(Ogre::ColourValue(0, 0, 0));
mCam->setAspectRatio(Ogre::Real(mViewport->getActualWidth()) /
Ogre::Real(mViewport->getActualHeight()));
// Resources
Ogre::ResourceGroupManager::getSingleton()
.addResourceLocation(mResourcePath, "FileSystem", "General");
Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
// Input
OIS::ParamList pl;
size_t windowHnd = 0;
std::ostringstream windowHndStr;
mWindow->getCustomAttribute("WINDOW", &windowHnd);
windowHndStr << windowHnd;
pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
mInputMgr = OIS::InputManager::createInputSystem(pl);
mKeyboard = static_cast<OIS::Keyboard*>(mInputMgr->createInputObject(OIS::OISKeyboard, true));
mMouse = static_cast<OIS::Mouse*>(mInputMgr->createInputObject(OIS::OISMouse, true));
mMouse->setEventCallback(this);
mKeyboard->setEventCallback(this);
windowResized(mWindow);
Ogre::WindowEventUtilities::addWindowEventListener(mWindow, this);
mRoot->addFrameListener(this);
mRunning = true;
// mRoot->startRendering();
while (mRunning) {
Ogre::WindowEventUtilities::messagePump();
if (!mRoot->renderOneFrame()) {
mRunning = false;
}
mWindow->update();
}
Thanks so much!