hotdot
27-11-2007 18:05:38
Hi,
When i run the demo any time i trace on SkinSetManager::getSingletonPtr or SkinSetManager::getSingleton they seem to be initialized properly (good singleton behaviour) but when i do the equivalent in my code of :
QuickGUI::SkinSetManager::getSingleton().loadSkin generates an error while trying to initialize the mouse cursor. In my code the data member ms_Singleton is NULL or 0x00000... Is there something to do before hand since i am not following the standard OGRE singleton in the declaration of my UserInterfaceManager Dll, we use our own manual singleton in each class, is this a bug when used outside of the ExampleApplication Class ? If so, then relying on Ogre Singleton could pose some potential problems when guessing that a static singleton should be instanciated on the first getSingleton call, as the following code from our managers :
Also i find that having a getSingletonPtr is bad since you can do &xxx::getSingleton if you really need a pointer.
When i run the demo any time i trace on SkinSetManager::getSingletonPtr or SkinSetManager::getSingleton they seem to be initialized properly (good singleton behaviour) but when i do the equivalent in my code of :
QuickGUI::SkinSetManager::getSingleton().loadSkin("qgui",QuickGUI::SkinSet::IMAGE_TYPE_PNG,mResourceGroup);
mGUIManager = new QuickGUI::GUIManager(mCamera->getViewport());
mGUIManager->setSceneManager(mSceneMgr);
QuickGUI::SkinSetManager::getSingleton().loadSkin generates an error while trying to initialize the mouse cursor. In my code the data member ms_Singleton is NULL or 0x00000... Is there something to do before hand since i am not following the standard OGRE singleton in the declaration of my UserInterfaceManager Dll, we use our own manual singleton in each class, is this a bug when used outside of the ExampleApplication Class ? If so, then relying on Ogre Singleton could pose some potential problems when guessing that a static singleton should be instanciated on the first getSingleton call, as the following code from our managers :
CEventManager& CEventManager::getSingleton()
{
if(m_Instance == NULL)
{
m_Instance = new CEventManager();
}
return *m_Instance;
}
Also i find that having a getSingletonPtr is bad since you can do &xxx::getSingleton if you really need a pointer.