I want to design a tool for editing collision proxies for ODE, using Ogre to render both proxies and the actual mesh. Anyway, it seemed rather difficult for me to integrate MFC/wxWindows with Ogre so I eventually came up with another idea. Why not use my favourite GUI tool Visual Basic instead? So I wrote a simple VB app that writes down GUI input as commands to a file. That file is also polled and read by Ogre and then parsed by Lua (which I would had to integrate anyway for game object scripting). So I have two windows up. One is the Ogre rendering window and the other is the VB app (see screenshot). Collision Tool
Works like a charm, almost... It seems Ogre will not render anything when its render window is deactivated. I came up with two solutions (see code below) and I dont like either of them. First is a hack in RenderSystem which work by calling update even if window is not active. The other solution is to not deactivate a window when it loses focus. I think the first solution is best because its closer to the real problem. The other solution might cause other troubles.
Now to my question. Is there another better way to solve this problem?
If there is none, then would it be in the interest of the community to add an option for rendering even if window is not active (as part of RenderWindow maybe)?
OgreRenderSystem.cpp
Code: Select all
void RenderSystem::_updateAllRenderTargets(void)
{
// Update all in order of priority
// This ensures render-to-texture targets get updated before render windows
RenderTargetPriorityMap::iterator itarg, itargend;
itargend = mPrioritisedRenderTargets.end();
for( itarg = mPrioritisedRenderTargets.begin(); itarg != itargend; ++itarg )
{
// Ignore active state --- if( itarg->second->isActive() )
itarg->second->update();
}
}
Code: Select all
case WM_ACTIVATE:
if( WA_INACTIVE == LOWORD( wParam ) )
// Ignore deactivate --- win->mActive = false;
win->mActive = true; // Always active!
else
win->mActive = true;
break;