MQuickGUI exception when creating GUIManager

Thoran

29-04-2008 14:34:23

Hello everyone!

I am new to MQuickGUI and currently try to get it running in a very simplistic way to see if it fits my needs.

So far I checked out the MQuickGUI SVN-version from the MOGRE repository and compiled it. Everything is fine. However as soon as I try to instanciate the GUIManager in my C# program I get a FileNotFound exception. An exemplary codeline would look like this



MQuickGUI.GUIManager locGUIManager = null;
locGUIManager = new GUIManager();


One or the other might complain that the GUIManager is a singleton and I should access it through the Singleton object. I also tried the code example from the wiki. The line causing the exception then would be:


GUIManager.Singleton._notifyWindowDimensions(800, 600); // Better update this to your current viewport's size!


It seems to have a problem with the second constructor GUIManager(width, height) (the default constructor works, but also refernces the second one where the exception gets thrown again), because everytime that one is used the exception is thrown. I didn't see such a behaviour before and wondered if anyone else struggled with that problem and could give me some help.

Any help is greatly appreciated.
Thoran

raygeee

29-04-2008 17:23:19

Could you post the exception please? It's hard to tell without it.

Did you add the resources like the wiki says under Setup? I'm guessing you are missing an image or the material file.
And yes you are right, you shouldn't use the constructor "new GUIManager()". MQuickGUI can only be used with the Singleton.

Thoran

06-05-2008 11:11:42

I changed the line to:


GUIManager.Singleton._notifyWindowDimensions(800, 600); // Better update this to your current viewport's size!


as a first line of using MQuickGUI.
I will recheck the resource files, however at this point it seems the resources are not loaded yet. I think I am missing that material file. Could that be the problem?

My exception looks as in the following images:


The whole exception stack. The german text says: "The specified module could not be found"


This is in QuickGUIManager.cs of MQuickGUI.

Anyone has any idea?

Cheers
Thoran

aeauseth

07-05-2008 16:26:21

I had a terrible time with MQuickGUI, and to be honest I don't have all the widgets working yet. But I've gotten far enough along to help you (I think).

1st off MQuickGUI is somewhat incomplete. You've already figured out there are no binaries :(

Did you notice that there aren't any MEDIA files in the MQuickGUI package? You need them! I downloaded the QuickGUIv0.9.7PreRelease to get the Media files. Copy all the QuickGUIv0.9.7PreRelease\bin\media\skins\qgui files to your current media location, or add the file location to your resources.cfg

Did you notice that you are still missing the qgui.material file? It needs to be where all the qgui media files are. Refer back to the MQuickGUI wiki and you will see what I'm talking about. It appears that the MQuickGUI wiki is somewhat out of date because I had to modify the qgui.material file as follows to get a mouse pointer:

material qgui.pointer
{
technique
{
pass
{
lighting off
alpha_rejection greater 150
scene_blend alpha_blend
texture_unit
{
texture qgui.cursor.png
}
}
}
}


Make sure you call '''ResourceGroupManager.Singleton.InitialiseAllResourceGroups''' before you start working with MQuickGUI.

Here are the code snipits I currently use for my mouse cursor:

Dim myMouse As MOIS.Mouse
myMouse = myInputManager.CreateInputObject(MOIS.Type.OISMouse, True)
Dim mousestate As MOIS.MouseState_NativePtr = myMouse.MouseState
mousestate.width = MyWindow.Width
mousestate.height = MyWindow.Height

MQuickGUI.GUIManager.Singleton._notifyWindowDimensions(MyWindow.Width, MyWindow.Height)
MouseCursor = MQuickGUI.GUIManager.Singleton.createMouseCursor(New Vector2(30, 30), "qgui.pointer")

Then I added the '''inject''' methods as described in the wiki.

Thoran

29-05-2008 21:33:38

I wanted to let you know that recompiling MQuickGUI with VS2008 solved my problem, so I guess it was something with compiler settings.

Thoran

TinyZombie

12-11-2008 16:23:29

I am having the same issue. Has anyone had success implimenting MQuickGUI in with VS2005?