XipherX
15-10-2012 16:24:22
Hi,
I'm currently using Mogre 1.7.1 with last repository Miyagi version Visual Studio 2012 and .NET framework 4.0.
The application uses a Mogre RenderWindow composed by multiple Mogre viewports and two Miyagi gui for each viewport.
Generally the application creates dinamically viewports as it needs them, the problem comes out when I have to dispose a single viewport.
Steps used for removing a single viewport (pseudo code):
After that I update the current active viewport of Miyagi system as follows:
But at this point when rendering process run I catch the following exception:
AccesViolationException......
in Mogre.HardwareIndexBufferSharedPtr.!HardwareIndexBufferSharedPtr()
in Mogre.HardwareIndexBufferSharedPtr.Dispose(Boolean )
in Mogre.HardwareIndexBufferSharedPtr.Finalize()
Please, can I have an help? Thx in advanced
I'm currently using Mogre 1.7.1 with last repository Miyagi version Visual Studio 2012 and .NET framework 4.0.
The application uses a Mogre RenderWindow composed by multiple Mogre viewports and two Miyagi gui for each viewport.
Generally the application creates dinamically viewports as it needs them, the problem comes out when I have to dispose a single viewport.
Steps used for removing a single viewport (pseudo code):
// removing a mogre camera
_sceneManager.DestroyCamera(_mogreCamera);
_mogreCamera = null;
if (_cameraNode != null)
{
_sceneManager.DestroySceneNode(_cameraNode);
_cameraNode = null;
}
// removing a mogre viewport
if(_mogreViewport != null)
{
_graphicScene.CurrentEwpControl.RenderWindow.RemoveViewport(_zOrder);
_mogreViewport = null;
}
// removing the guis
var bIsGuiDisposed = true;
// first gui
if (_guiViewport != null)
{
_guiViewport.SpriteRenderer.Viewport = null;
_guiViewport.Dispose();
bIsGuiDisposed = _guiViewport.IsDisposed;
_guiViewport = null;
}
// second gui
if (_guiObjectMenu != null)
{
_guiObjectMenu.SpriteRenderer.Viewport = null;
_guiObjectMenu.Dispose();
bIsGuiDisposed = bIsGuiDisposed && _guiObjectMenu.IsDisposed;
_guiObjectMenu = null;
}
_bIsDisposed = bIsGuiDisposed;
After that I update the current active viewport of Miyagi system as follows:
_currentViewport = activeViewport;
_mainCamera = _currentViewport.Camera;
// manage of Miyagi render manager
var miyagiMogreRenderManager = (Miyagi.Backend.Mogre.MogreRenderManager) GUISystem.RenderManager;
miyagiMogreRenderManager.SceneManager = null;
miyagiMogreRenderManager.SceneManager = _sceneManager;
// active viewport (working)
var miyagiViewport = _currentViewport.GUIViewport.SpriteRenderer.Viewport;
GUISystem.RenderManager.MainViewport = null;
GUISystem.RenderManager.MainViewport = miyagiViewport;
GUISystem.Backend.RenderManager.MainViewport = miyagiViewport;
But at this point when rendering process run I catch the following exception:
AccesViolationException......
in Mogre.HardwareIndexBufferSharedPtr.!HardwareIndexBufferSharedPtr()
in Mogre.HardwareIndexBufferSharedPtr.Dispose(Boolean )
in Mogre.HardwareIndexBufferSharedPtr.Finalize()
Please, can I have an help? Thx in advanced