Hydrax + Caelum + Alt tab = Crash!

al2950

11-03-2009 10:44:57

Hi

I have an annoying little problem which i currently dont understand....

When i run my game in windowed mode (works fine in fullscreen) using both Hydrax 0.5 and Caelum 0.4 and then Alt-Tab away from the window it crashes with the error:

Ogre Exception: This parse does not have a vertex program assigned! in pass::getVertexProgramParameters at ..\src\OgrePass.cpp (line 1360)

It does not crash when i am using EITHER hydrax OR caelum, it only crashes when i am using Hydrax AND Caelum together.

I have combed through my code and removed pretty much everything else so i am pretty sure its not mine, but I would really appreciate it if some else who is running the two libraries could try alt-tabbing whilst in a window mode to make sure its not me!!!

Cheers

Angus

nargil

11-03-2009 13:29:24

I confirm, but it's caelum causing the problem when hydrax's depth technique is added to the materials. You need anyway a listener to update caelums sun position/color/etc to hydrax so you may aswell add there a code to disable the caelum listener if the window is inactive. Here is my code


if(mEngine->getWindow()->isActive())
{
if(!CaelumAdded) // this is a bool variable in the listener class
{
mEngine->getRoot()->addFrameListener(mCaelumSystem);
CaelumAdded=true;
}
Ogre::Real jdn = mCaelumSystem->getJulianDay();
Ogre::Vector3 dir = mCaelumSystem->getSunDirection(jdn);
Ogre::ColourValue sunColor = mCaelumSystem->getSunLightColour(jdn,dir);
mHydrax->setSunPosition(mCaelumSystem->getSun()->getSceneNode()->getPosition());
mHydrax->setSunColor(Ogre::Vector3(sunColor.r,sunColor.g,sunColor.b));
sunColor = mEngine->getSceneMgr()->getAmbientLight();
mHydrax->setWaterColor(mBaseWaterColor*Ogre::Vector3(sunColor.r,sunColor.g,sunColor.b));
mHydrax->update(evt.timeSinceLastFrame);
}
else
{
mEngine->getRoot()->removeFrameListener(mCaelumSystem);
CaelumAdded=false;
}

al2950

11-03-2009 15:02:00

Cheers!

Angus