Page 1 of 1

Ogre Integration with game state manager

Posted: 08 Dec 2012, 21:20
by Olivier
Hello,

I spent the day to continue my tests with NoesisGUI.
It is relatively simple to use (thanks to the examples).
I created a simple interface which works fine rapidly, so this is pleasant ^^

After this tests, I tried to create a game state manager which use NoesisGUI for the 2D render.
I have two state : menuState and playState.

This two state use (from the Ogre exemple) :
Noesis_Init
Noesis_LoadXAML
Noesis_Shutdown

When the program enter the first time in the menu, there are no problem, the GUI is correctly created and work fine.
During the change state Noesis_Shutdown is call for the menu and Noesis_Init is call a second time for the state playState.
But during the second Init (on Noesis_Init) the program crash on the line NsGetKernel()->Init();
I can't debug more and I am not a experimenting developer.

Noesis_Shutdown is call before launch a second time Noesis_Init. So NsGetKernel()->Shutdown(); is call before launch again NsGetKernel()->Init();

Is it a problem of my side or the shutdown which don't delete all ?
Maybe that would have been better if I unload XAML to load a XAML only whitout destroy all Noesis.

Help me if possible :)
Thanks.

Re: Ogre Integration with game state manager

Posted: 10 Dec 2012, 13:27
by jsantos
Hi!

Noesis_Init() and Noesis_Shutdown() are expected to be called once. The idea is that you invoke these functions at startup and then you load/unload as many xamls as you need in your aplication.