Page 1 of 1

Direct3D Render System crash on resize?

Posted: Mon Nov 09, 2009 9:46 pm
by boyamer
Hi,i'm using DirectX9 REnder System from trunk embeded into windows forms,but i'm getting exception on resizing,maximizing the windows,seams that reseting device can't be done..here is the log when crashing:

Code: Select all

Info : D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
2009-11-09 21:51:33.7325 , Info : OGRE EXCEPTION(3:RenderingAPIException): Cannot reset device! in D3D9RenderWindow::reset at ..\..\..\RenderSystems\Direct3D9\src\OgreD3D9Device.cpp (line 419)
2009-11-09 21:51:34.0205 , Info : OGRE EXCEPTION(3:RenderingAPIException): Cannot lock D3D9 vertex buffer: Invalid call in D3D9HardwareVertexBuffer::updateBuffer at ..\..\..\RenderSystems\Direct3D9\src\OgreD3D9HardwareVertexBuffer.cpp (line 323)
2009-11-09 21:51:34.1075 , Info : OGRE EXCEPTION(3:RenderingAPIException): Cannot lock D3D9 vertex buffer: Invalid call in D3D9HardwareVertexBuffer::updateBuffer at ..\..\..\RenderSystems\Direct3D9\src\OgreD3D9HardwareVertexBuffer.cpp (line 323)
2009-11-09 21:51:34.2225 , Info : OGRE EXCEPTION(3:RenderingAPIException): Cannot lock D3D9 vertex buffer: Invalid call in D3D9HardwareVertexBuffer::updateBuffer at ..\..\..\RenderSystems\Direct3D9\src\OgreD3D9HardwareVertexBuffer.cpp (line 323)
2009-11-09 21:51:34.3175 , Info : OGRE EXCEPTION(3:RenderingAPIException): Cannot lock D3D9 vertex buffer: Invalid call in D3D9HardwareVertexBuffer::updateBuffer at ..\..\..\RenderSystems\Direct3D9\src\OgreD3D9HardwareVertexBuffer.cpp (line 323)
Anyone knows why?

Thanks

Re: Direct3D Render System crash on resize?

Posted: Tue Nov 10, 2009 6:24 pm
by sinbad
Stack trace at the exception? To me this looks like you have a frame loop where you're manually locking buffers, which you can't do during a device lost condition, you'll have to check for the RenderSystem lost/restore events and pause your locking in that period (Ogre already does this with its own updates).

Re: Direct3D Render System crash on resize?

Posted: Tue Nov 10, 2009 7:59 pm
by boyamer
Thank you very mich Sinbad :)