CeguiDotNet

humantargetjoe

16-06-2006 16:31:46

I'm attempting to get CeguiDotNet up and running (C++ 2005), and have encountered a problem that looks like it's come up before for VB users, but whose solution is not working for me.

My code looks like this:

Cegui::OgreCEGUIRenderer^ GuiRenderer = gcnew Cegui::OgreCEGUIRenderer(RenderWnd);
GuiRenderer->Initialise();
GuiRenderer->setTargetSceneManager(mSceneMgr);
CeguiDotNet::GuiSystem^ GuiSystem =
CeguiDotNet::GuiSystem::CreateGuiSystemSpecial(GuiRenderer);


As I step through it in the debugger I find that I have a pair of System::TypeInitializationExceptions. One for the EventDisplaySizeChanged (haven't changed it, it's hard coded to 800x600 windowed) and one for EventNamespace (no idea what would cause that).

It looked like previous posters failed to call initialise() and that caused the following PInvoke error that I get:
public static GuiSystem CreateGuiSystemSpecial(Renderer renderer)
{
return new GuiSystem( CeguiBindingsPINVOKE.new_GuiSystem__SWIG_1(Renderer.getCPtr(renderer)), false);
}


This happens basically any time I try to do anything with CeguiDotNet. I can't create windows, I can't access the Scheme or Window Managers, etc.

I also get this PInvoke error on exit:
public virtual void Dispose() {
if(swigCPtr.Handle != IntPtr.Zero && swigCMemOwn) {
swigCMemOwn = false;
CeguiBindingsPINVOKE.delete_Renderer(swigCPtr);
}


So it looks like even though it sees Cegui, none of it is actually there to use. I've rebuilt the CeguiDotNet and OgreDotNet.Cegui wrappers multiple times, reinvoked SWIG, etc, and it has failed to solve the issue.

So I'm at a loss as to how I might go about getting a functional OgreCEGUIRenderer, and am hoping some folks might have a solution. Similarly, all the demos that use CEGUI crash in the same place.

humantargetjoe

22-06-2006 12:54:42

I was wondering if anyone could take a peak at their CeguiBindings_wrap.cxx file and let me know if they have the same function as this:

SWIGEXPORT void * SWIGSTDCALL CSharp_new_GuiSystem__SWIG_1(void * jarg1) {
void * jresult ;
CEGUI::Renderer *arg1 = (CEGUI::Renderer *) 0 ;
CEGUI::System *result = 0 ;

arg1 = (CEGUI::Renderer *)jarg1;
result = (CEGUI::System *)new CEGUI::System(arg1);
jresult = (void *)result;
return jresult;
}


It seems like my Cegui::OgreCEGUIRenderer is fine, as it can execute some function calls, so my next thought is that it has to be the way (or maybe just what) the CeguiDotNet library is trying to do.

humantargetjoe

22-06-2006 15:12:05

Also, I know that the native CEGUI libraries are functional, as I have projects using them that function fine.

Anyone able to post the *.cs files for the CeguiDotNet_vcs8 and OgreNet.CeguiRenderer_vcs8 solutions?