cg76
09-03-2009 04:26:31
Hi all,
When I alt-tab to another application,
will cause an assertion failure. What could be the problem? I tried alt-tab while running Caelum Demo and it does not cause any assertion failure.
This is my code for initializing Caelum (identical to Caelum Demo):
and the code to register Caelum in my main application:
Thanks,
CG
When I alt-tab to another application,
assert (mMoonMaterial->getBestTechnique ()->getPass( 0)->hasFragmentProgram ());
will cause an assertion failure. What could be the problem? I tried alt-tab while running Caelum Demo and it does not cause any assertion failure.
This is my code for initializing Caelum (identical to Caelum Demo):
CaelumFrameListener::CaelumFrameListener(Ogre::RenderWindow* win, Ogre::Camera* cam)
: Ogre::FrameListener()
, mWindow(win)
, mCamera(cam)
, mPaused(true)
{
mSceneMgr = mCamera->getSceneManager();
// Pick components to create in the demo.
// You can comment any of those and it should still work
// Trying to disable one of these can be useful in finding problems.
Caelum::CaelumSystem::CaelumComponent componentMask;
componentMask = static_cast<Caelum::CaelumSystem::CaelumComponent> (
Caelum::CaelumSystem::CAELUM_COMPONENT_SUN |
Caelum::CaelumSystem::CAELUM_COMPONENT_MOON |
Caelum::CaelumSystem::CAELUM_COMPONENT_SKY_DOME |
Caelum::CaelumSystem::CAELUM_COMPONENT_POINT_STARFIELD |
Caelum::CaelumSystem::CAELUM_COMPONENT_CLOUDS |
0);
componentMask = Caelum::CaelumSystem::CAELUM_COMPONENTS_DEFAULT;
// Initialise CaelumSystem.
mCaelumSystem = new Caelum::CaelumSystem ( Root::getSingletonPtr(), mSceneMgr, componentMask );
mCaelumSystem->setPrecipitationController(new Caelum::PrecipitationController(mSceneMgr));
mCaelumSystem->getPrecipitationController()->createViewportInstance(mViewport);
// Set time acceleration.
mCaelumSystem->getUniversalClock()->setTimeScale(512);
// Register caelum as a listener.
mWindow->addListener(mCaelumSystem);
Root::getSingletonPtr()->addFrameListener(mCaelumSystem);
mCaelumSystem->setManageSceneFog(false);
mCaelumSystem->setManageAmbientLight(true);
UpdateSpeedFactor(mCaelumSystem->getUniversalClock ()->getTimeScale());
}
and the code to register Caelum in my main application:
mCaelumListener = new CaelumFrameListener( mRoot->getAutoCreatedWindow(), mCamera );
mRoot->addFrameListener(mCaelumListener);
Thanks,
CG