Big problem

zolt4n

14-12-2007 13:52:20

I just updated my project from svn.

And know I have a segfault

in this line

QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui", QuickGUI::SkinSet::IMAGE_TYPE_PNG);


QuickGUI::SkinSetManager::getSingletonPtr() is allways NULL

something changed ???



initialize


// create resource group for QuickGUI
Ogre::String mResourceGroup = "quickgui";
Ogre::ResourceGroupManager *rsm=Ogre::ResourceGroupManager::getSingletonPtr();
Ogre::StringVector groups = rsm->getResourceGroups();
if (std::find(groups.begin(), groups.end(), mResourceGroup) == groups.end())
rsm->createResourceGroup(mResourceGroup);
QuickGUI::registerScriptParser();

...
Ogre::ResourceGroupManager::getSingletonPtr()->initialiseAllResourceGroups();
...

QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui", QuickGUI::SkinSet::IMAGE_TYPE_PNG);
mGUIManager = new GUIManager(name, _viewPort);
mGUIManager->setSceneManager(_SceneMgr);

Qbound

14-12-2007 18:09:30

Hi,

you have to create the root before... look in the example app...

for lazy people like me...

new QuickGUI::Root();

m_pResMgr->addResourceLocation( "data/gui/fonts", "FileSystem", "General" );
m_pResMgr->addResourceLocation( "data/gui/qgui", "FileSystem", "General" );
m_pResMgr->addResourceLocation( "data/gui/nf", "FileSystem", "General" );
QuickGUI::registerScriptParser();
m_pResMgr->initialiseResourceGroup( "General" );
QuickGUI::SkinSetManager::getSingleton().loadSkin( "qgui", QuickGUI::SkinSet::IMAGE_TYPE_PNG, "General" );
QuickGUI::SkinSetManager::getSingleton().loadSkin( "nf", QuickGUI::SkinSet::IMAGE_TYPE_PNG, "General" );

m_pGUIManager = QuickGUI::Root::getSingleton().createGUIManager( m_pViewPort );

m_pGUIManager->setSceneManager( m_pSceneMgr );



here is the doc from the masta



Revision 288

Other:
- QuickGUI::Root class. Create this before loading SkinSets. Registering the config parser is still required as before. It is a singleton, and manages creation/destruction of GUIManagers. Just make sure to create and destroy the Root!

zolt4n

15-12-2007 09:54:18

ha thx you.

I have a suggestion why not have a default GUImanager by singleton ??

kungfoomasta

15-12-2007 10:38:36

That's not possible. GUIManager requies a viewport, and I won't know what viewport you create. Additionally, I'd like to give the user the power to decide when and where to create a GUIManager. :)

zolt4n

15-12-2007 12:15:11

you can set this getsingleton(_viewport) et en fonctin du viewport ca renvoi un pointeur ou lautre