kerozcak
03-02-2008 00:11:59
I have problem using mRoot.RenderOneFrame() in loop, instead of using mroot.StartRendering() (I want window to be rendered even if it doesn't have focus).
I'm not using MogreFramework nor Windows.Forms. Code is similar to ExampleApplication.
I thought i would set mRenderWindow.IsActive to True and then call RenderOneFrame() in loop. But there is the problem with IsActive even if i'm not setting it anywhere:
Method 1):
When i use method 1) everything is fine, and when i change focus to other window i see that Ogre window stopped rendering (i guess it's because mRootWindow.IsActive has been set to false).
Method 2):
When i use method 2) and change focus to other window, Ogre window keeps rendering frames, but i see in Console window that mRootWindow.IsActive is still set to True, and when i want Ogre window get back, it doesn't show up. Also, using this method, i can't move Ogre window around the screen.
I have no idea why it works that way, because StartRendering() method seems to be almost the same as RenderOneFrame() in loop (you can see that in OgreRoot.cpp, line 722).
I would appreciate any help.
I'm not using MogreFramework nor Windows.Forms. Code is similar to ExampleApplication.
I thought i would set mRenderWindow.IsActive to True and then call RenderOneFrame() in loop. But there is the problem with IsActive even if i'm not setting it anywhere:
Method 1):
public void Start()
{
int i = 0;
if (!Setup()) return;
mRoot.StartRendering();
}
When i use method 1) everything is fine, and when i change focus to other window i see that Ogre window stopped rendering (i guess it's because mRootWindow.IsActive has been set to false).
Method 2):
public override void Start()
{
int i = 0;
if (!Setup()) return;
//mRoot.StartRendering();
while (true)
{
Console.WriteLine(mRenderWindow.IsActive + " " + " " + mRenderWindow.IsVisible + " " + i++);
if (i > 10) i = 0;
if (!mRoot.RenderOneFrame())
break;
}
}
When i use method 2) and change focus to other window, Ogre window keeps rendering frames, but i see in Console window that mRootWindow.IsActive is still set to True, and when i want Ogre window get back, it doesn't show up. Also, using this method, i can't move Ogre window around the screen.
I have no idea why it works that way, because StartRendering() method seems to be almost the same as RenderOneFrame() in loop (you can see that in OgreRoot.cpp, line 722).
I would appreciate any help.