I can't get any of the 1.7.x samples to run in D3D mode.

jjm152

16-05-2010 06:21:21

Hello All,

First off, I admit to being fairly intermediate with VS. That aside, I've spent a few hours searching the forums here and trying various solutions to my problem, but to no avail - so I am attempting to ask for help directly! :)

My OS is Windows Vista. I have currently installed the Visual Studio 2008 SP1. I have also installed D3D9 on my system. I have checked my WINSXS directory for the VC80 debug dll's and they are present (albiet, the version number is .42 on the files... I did see the post about modifying the Policy file, but alas I don't HAVE a policy directory on my machine, so I'm at a bit of a loss there). I've also added the Mogre installation location (bin and Release) to my system path.

I can run the samples in OpenGL just fine, but whenever I attempt to use the D3D renderer or launch the Winforms sample I get a CTD with no message or anything hinting at a problem in the log.

When I try to build and launch the samples from the debugger I get all sorts of errors which leads me to believe that I need to tinker with the project configuration.

Regardless of that, I have been able to snag one error from a command window running one of the samples. Here is what it says:


Unhandled Exception: System.AccessViolationException: Attempted to read or write
protected memory. This is often an indication that other memory is corrupt.
at Ogre.ResourceGroupManager.initialiseAllResourceGroups(ResourceGroupManager
* )
at Mogre.ResourceGroupManager.InitialiseAllResourceGroups() in d:\devel\gamed
evel\mogre\main\src\auto\mogreresourcegroupmanager.cpp:line 385
at Mogre.Demo.ExampleApplication.Example.LoadResources() in c:\MogreSDK\Sampl
es\ExampleApplication\Example.cs:line 453
at Mogre.Demo.ExampleApplication.Example.Setup() in c:\MogreSDK\Samples\Examp
leApplication\Example.cs:line 82
at Mogre.Demo.ExampleApplication.Example.Go() in c:\MogreSDK\Samples\ExampleA
pplication\Example.cs:line 51


Again, that same application works very nicely if I choose OpenGL as the renderer.

Any help getting this moving over here would be greatly appreciated. Thank you!

jjm152

16-05-2010 09:07:57

I messed around with the project a little bit in Visual Studio.

Using the Winforms example, I am able to run it through the debugger. I still get the same error being thrown by the resource group initialization, but I can step past that and the form will launch. When I close the form, I get this error thrown by the dispose():


at Ogre.Root.{dtor}(Root* )
at Ogre.Root.__delDtor(Root* , UInt32 )
at Mogre.Root.!Root() in d:\devel\gamedevel\mogre\main\include\auto\mogreroot.h:line 72
at Mogre.Root.~Root() in d:\devel\gamedevel\mogre\main\include\auto\mogreroot.h:line 56
at Mogre.Root.Dispose(Boolean ) in d:\devel\gamedevel\mogre\main\include\auto\mogreroot.h:line 0
at Mogre.Root.Dispose()
at Mogre.Demo.MogreForm.OgreWindow.Dispose() in C:\MogreSDK\Samples\MogreForm\MogreForm.cs:line 152
at Mogre.Demo.MogreForm.MogreForm.MogreForm_Disposed(Object sender, EventArgs e) in C:\MogreSDK\Samples\MogreForm\MogreForm.cs:line 32
at System.ComponentModel.Component.Dispose(Boolean disposing)
at System.Windows.Forms.Control.Dispose(Boolean disposing)
at System.Windows.Forms.ContainerControl.Dispose(Boolean disposing)
at System.Windows.Forms.Form.Dispose(Boolean disposing)
at Mogre.Demo.MogreForm.MogreForm.Dispose(Boolean disposing) in C:\MogreSDK\Samples\MogreForm\MogreForm.Designer.cs:line 20
at System.ComponentModel.Component.Dispose()
at System.Windows.Forms.Form.WmClose(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Form.DefWndProc(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmSysCommand(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr wndProc, IntPtr hWnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at System.Windows.Forms.NativeWindow.DefWndProc(Message& m)
at System.Windows.Forms.Form.DefWndProc(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmNcButtonDown(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Mogre.Demo.MogreForm.Program.Main() in C:\MogreSDK\Samples\MogreForm\Program.cs:line 17


I'll try building one of the projects that I can run in OpenGL next and see if that somehow narrows down the investigation for me, but I've got a suspicion that this is beyond my experience :)

mstoyke

19-05-2010 23:27:12

I also got exceptions in my mogre 1.6.5 based codebase on shutdown in the past. I have not yet seen that happen in 1.7.1 but it may still be there just waiting to crash my app when I don't expect it :) but I remember that it happened in relation to the resource manager being shut down.

My theory is that there is some kind of race condition caused by the fact that in .NET garbage collection is actually happening in another thread. I'm still investigating it but I can't analyze it until my code crashes again (which did not happen for some time now).