MOGRE.CEGUI problems


12-07-2007 15:31:14

I'm porting a sample from OgreDotNet by I has an exception

No se controló System.TypeInitializationException
Message="Se produjo una excepción en el inicializador de tipo de 'Mogre.Cegui.OgreBindings_CeguiPINVOKE'." (Type Initialization exception )
en Mogre.Cegui.OgreBindings_CeguiPINVOKE.new_OgreCEGUIRenderer__SWIG_4(IntPtr jarg1, Byte jarg2, Boolean jarg3, UInt32 jarg4, IntPtr jarg5)
en Mogre.Cegui.OgreCEGUIRenderer..ctor(RenderWindow window, Byte queue_id, Boolean post_queue, UInt32 max_quads, SceneManager scene_manager)
en MogreWindow.OgreStartup.CreateScene() en C:\Documents and Settings\alberto\Mis documentos\Visual Studio 2005\Projects\MogreWindow\MogreWindow\Program.cs:línea 173
en MogreWindow.OgreStartup.Go() en C:\Documents and Settings\alberto\Mis documentos\Visual Studio 2005\Projects\MogreWindow\MogreWindow\Program.cs:línea 70
en MogreWindow.Program.Main() en C:\Documents and Settings\alberto\Mis documentos\Visual Studio 2005\Projects\MogreWindow\MogreWindow\Program.cs:línea 18
en System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)
en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
en System.Threading.ThreadHelper.ThreadStart_Context(Object state)
en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
en System.Threading.ThreadHelper.ThreadStart()


mGuiRenderer = new OgreCEGUIRenderer(mWindow, (byte) RenderQueueGroupID.RENDER_QUEUE_OVERLAY, false, 3000, mgr);


14-07-2007 18:10:16


Is impossible!!! Always the PINVOKE exception fuuuuuuuuuck


15-07-2007 08:20:41

Hi there!

I am not familiar in any way with Cegui or the Mogre bindings. I dont think we have the code fore these DLL and they might me outdated or out of sync with CEGUI.

But, maybe I can give you some tips to help you debug this. Let's troubleshoot this.

First, try to see what is going on in Mogre.Cegui when you call the constructor. A tool like Reflector ( will help you look at the code inside this DLL for which we dont seem to have the code (it is not in the SVN afaik).

Then, if you look at the call stack, you see that at some point the OgreBindings_CeguiPINVOKE.new_OgreCEGUIRenderer__SWIG_4() is called. This method is actually a DllImport of OgreBindings_Cegui.dll. Is the DLL available, is it in your app folder ? This is an unmanaged DLL, so are you sure it still matches the current CEGUI ? Does it actually have a method called "CSharp_new_OgreCEGUIRenderer__SWIG_4" that takes 5 parameters. (Use a tool like "depends.exe" to look at unmanaged DLL entry points).

Then, if this DLL is present and valid (OgreBindings_Cegui.dll). It required CeguiBase.dll. Again, is it in your app folder ? Do the version matches ? Are all the calls resolved in depends ? Etc...

Have fun!



15-07-2007 11:42:09

All the dependencies are in my Debug directory. All was copied from ogreSDK/bin/Release, generated by the MOGRE installer.

In other post Bekas and others say that this implementaion is a port from OgreDotNet.

So, if this is outdated or hasn't support at now, what does GUI rendersystem you advise to me?



15-07-2007 17:01:52

Hi there!

I tried what you said and I confirm the Exception you have when you call the OgreCEGUIRenderer constructor. Here the exception and the inner exceptions :

+ [System.TypeInitializationException] {"The type initializer for 'Mogre.Cegui.OgreBindings_CeguiPINVOKE' threw an exception."} System.TypeInitializationException
- _innerException {"The type initializer for 'SWIGExceptionHelper' threw an exception."} System.Exception {System.TypeInitializationException}
- _innerException {"Unable to load DLL 'OgreBindings_Cegui': The specified procedure could not be found. (Exception from HRESULT: 0x8007007F)"} System.Exception {System.DllNotFoundException}

So, I opened depends.exe and I noticed that some calls cannot be resolved in OgreMain.dll, CeguiBase.dll and OgreGuiRenderer.dll. This mean that OgreBindings.dll is badly outdated....

You are right, this DLL is from OgreDotNet which is pretty much dead.

So what should we do ? Get the OgreDotNet code and re-run SWIG ?

I'm open for suggestions.



15-07-2007 17:25:24

I read about CEGUI#, But I think is in early development state.

Look at svn, are some files, but in downloads is empty. Or write our own GUI as an Ogre 2D app?


15-07-2007 18:26:13

Hi guys (and girls, there is someone?),

I porting QuickGUI ( to C#. It needs some work, but will be ready soon.

I will post sources and samples later.

The pros:

- MOIS friendly
- Mogre friendly
- Re write event model (Its done with delegates and events) [is working works fine]


- Support animated widgets (think in rolling buttons, when RollOverMouse) [Flash style]
- Support for simple 3D meshes show (think in a small mesh on a Combo Box)

I will keep you informated!


15-07-2007 18:55:59

Sounds cool.

May be I wait for it?
If you need some help I can help you.
leontiscar AT gmail POINT com


19-07-2007 00:57:51

So whats the solution to this problem, I've have searched everywhere and the is nobody giving a solution


19-07-2007 15:45:37

So whats the solution to this problem, I've have searched everywhere and the is nobody giving a solution

For me i see two options:

* Bring OgreBindings.dll back to life
* Wait for GermanDZs port of QuickGUI

the later is what i'm doing right now *wink* as i prefer a direct dotnet-implementation.

I will keep you informated!

I'm looking forward to it ;) Hows work going on?