HRB
25-09-2008 07:30:19
Hi there!
I've stumbled upon a AccessViolation when I tried to modify tut6.
I replaced:
with:
At first everything seems to be fine. BUT if I close the window -> AccessViolation.
This will also happen if I don't even register the FrameStarted method as a listener to mRoot!
Is there something that needs to be done when I use StartRendering() instead of RenderOneFrame()?
Might there be another way to get the timeSinceLastFrame?
I've stumbled upon a AccessViolation when I tried to modify tut6.
I replaced:
public void Go()
{
while (mRoot != null && mRoot.RenderOneFrame())
{
MoveCam();
Application.DoEvents();
Thread.Sleep(INTERFRAMEPAUSE); // fps limit
}
}
with:
bool FrameStarted(FrameEvent evt)
{
deltaT = evt.timeSinceLastFrame; // for fps independend cam
MoveCam();
Application.DoEvents();
Thread.Sleep(INTERFRAMEPAUSE); // limit fps
return mRoot != null;
}
public void Go()
{
mRoot.StartRendering();
}
At first everything seems to be fine. BUT if I close the window -> AccessViolation.
This will also happen if I don't even register the FrameStarted method as a listener to mRoot!
Is there something that needs to be done when I use StartRendering() instead of RenderOneFrame()?
Might there be another way to get the timeSinceLastFrame?