Segmentation Fault in loadskin() function

medo87

04-06-2009 19:15:31

Hello everybody,

I have downloaded and compiled QuickGUI and the demo from the SVN, having few problems in dynamic castings, but managed those. When I try to run the QuickGUIDemo I get a segmentation fault in 302 of the QuickGUIDemo.h file specifically
QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui",QuickGUI::SkinSet::IMAGE_TYPE_PNG,mResourceGroup);

Any ideas of the cause and how to fix it?

Your help is greatly appreciated.
Thanks

kungfoomasta

08-06-2009 19:10:06

Sorry for the late response, I haven't been lurking Ogre forums much in the past week. It looks like your version of QuickGUI is really old, there is no SkinSetManager class anymore, it was removed a while back when the skinning system was redone. Maybe you need to clean out all the old QuickGUI files and rebuild the library with the latest?

medo87

08-06-2009 20:25:58

No worries at all, I have downloaded the QuickGUI files from SVN, running svn info it says the last edit was sometime in March, I don't have my laptop here with me now to give you exact details. was the class removed after March or is it before that.
Thanks
Ahmed

kungfoomasta

08-06-2009 22:57:08

Maybe you're using the old repository from Assembla, the current SVN details are in this thread:

http://www.ogre3d.org/addonforums/viewtopic.php?f=13&t=9467

I think my latest commit was this month, and if not, the end of May, so that repository you're using isn't the correct one.

medo87

08-06-2009 23:45:20

Ok thanks a lot, I will try this one and will let you know.

Edit: Thanks a lot. Is it possible to run PlayPen under linux? or is there any good tutorials I should use?.

medo87

09-06-2009 18:19:26

I am having another problem now :? .
When I try running QuickGUIEditor, I my entire system gets hung up. Any help would be greatly appreciated.
Thanks a lot

kungfoomasta

09-06-2009 19:16:00

The Editor is not complete, and I haven't tried running it under Linux. You could see if there was a log generated and post its contents, or stepping through the code. Its not something I can easily debug with my current setup, unfortunately.

medo87

10-06-2009 17:03:59

Thank you Masta for the quick replies
I was using the editor as an example of how to use quickGUI, anyway, it gets stuck in the main loop in _start(). I have looked into this function but can not understand why it gets stuck there.

I get similar problem when I run my own code, following tutorial 1. except in this case the window is created and it gets stuck after initializing OIS. any ideas?

kungfoomasta

10-06-2009 18:45:17

OIS isn't related to QuickGUI in any way, QuickGUI works by having users inject input into the GUIManager. I've written the code to initialize OIS a few times, but I can't recall it in detail. You can use the Editor, PlayPen, and Ogre example framework as reference to to setting up OIS.

medo87

10-06-2009 18:54:02

OIS isn't related to QuickGUI in any way, QuickGUI works by having users inject input into the GUIManager. I've written the code to initialize OIS a few times, but I can't recall it in detail. You can use the Editor, PlayPen, and Ogre example framework as reference to to setting up OIS.

Yes I understand it is not related to QuickGUI, but the problem only happens when I am using QuickGUI. I can the section I use to initialize quickGUI if that would help.

Thanks a lot

kungfoomasta

10-06-2009 19:43:42

Ah sorry, I assumed it wasn't related to QuickGUI.. :oops:

Can you post your code and the log? I don't work on Linux, but I don't think there are special setups specific to that platform. If you can outline the last executable line of code that might help.

You can also try following the wiki tutorial, although I don't cover OIS at all.. http://www.ogre3d.org/wiki/index.php/QuickGUI_Beginner_Tutorial_1

medo87

10-06-2009 20:33:53

No problem at all, I didn't make myself clear from the beginning. Here is the setup code
//Create the GUI Manager
QuickGUI::GUIManagerDesc d;
d.sceneManager = mSceneMgr;
d.viewport= mCamera->getViewport();
d.queueID = Ogre::RENDER_QUEUE_OVERLAY;
QuickGUI::GUIManager* mGUIMgr = gRoot->createGUIManager(d);
cout << "created gui mgr" << endl;
//Create the sheet, could be done through .sheet file.
QuickGUI::SheetDesc* sd = QuickGUI::DescManager::getSingleton().getDefaultSheetDesc();
sd->resetToDefault();
sd->widget_dimensions.size = QuickGUI::Size(300,300);
QuickGUI::Sheet* mSheet = QuickGUI::SheetManager::getSingleton().createSheet(sd);
cout<<"created sheet" << endl;
mGUIMgr->setActiveSheet(mSheet);
cout << "active sheet is set" << endl;
//createGUI(mSheet);

I based my framework on Ogre Examples, and the last line of code mRoot->startRendering(); inside the go() function in ExampleApplication.h
Thanks alot

kungfoomasta

10-06-2009 20:38:05

I don't see anything wrong with that code, but if you haven't created QuickGUI::Root class, an exception would probably be thrown. Also make sure you're registering the QuickGUI Script Parser prior to initialization of the resource groups, and call "loadSkins". Its all documented in the wiki tutorial.

It sounds like it would be beneficial if I included a wiki example of using the example framework with QuickGUI. Not sure when I can get time to do this, but I'll keep it on my TODO list.

medo87

10-06-2009 20:44:14

... Also make sure you're registering the QuickGUI Script Parser prior to initialization of the resource groups, and call "loadSkins". ....

Yeah I have created the QuickGUI::Root just forgot to copy Sorry :oops: , The ScriptReader is registered in a different function before the initialization is done.
Could it be a driver or something like that?even though ogre works just fine.

kungfoomasta

10-06-2009 23:31:27

QuickGUI uses the same shaders as RBGUI for its rendering, I believe shader model 2.0 is required, but I don't know if that would cause a crash. Does the ogre.log say anything?