Ogre 1.9.0 & SdkTrayManager

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
germanmax
Gnoblar
Posts: 11
Joined: Thu Apr 25, 2013 5:21 pm

Ogre 1.9.0 & SdkTrayManager

Post by germanmax »

Hey Guys,
My name's Max and I'm new to the ogre forums. I registered to ask a question I couldn't find using the search function. At the moment I'm trying to build a menu using the OgreBites SdkTrayManager. I initialized the whole thing, like the Frameworks provided do and it does compile correctly. When I'm running the program thou, I'm getting following error in the LOG and the game closes immediately:
18:16:55: OGRE EXCEPTION(5:ItemIdentityException): OverlayElement with name SdkTrays/Cursor not found. in OverlayManager::getOverlayElementImpl at ..\..\..\Components\Overlay\src\OgreOverlayManager.cpp (line 611)
18:16:55: ERROR: OGRE EXCEPTION(5:ItemIdentityException): OverlayElement with name SdkTrays/Cursor not found. in OverlayManager::getOverlayElementImpl at ..\..\..\Components\Overlay\src\OgreOverlayManager.cpp (line 611)
I looked for several reasons, therefor I checked if the resource.cfg is loaded correctly and the resources are initialized and they are. When I'm checking the Resources with a debugger the SdkTrays.zip is loaded and it finds an array with all the zip-containing .overlay, .material, and .png, such as sdk_cursor.png.

Additionaly to that the frameworks seem to be for SDK 1.8.0, since I had to initialize the OverlaySystem instead of just declaring it. If I'm not initializing I'm getting a msSingleton Error on running the game.

But to clarify my situation, here are the classes regarding that problem:

MenuAbstract (AbstractClass for all Menu's)

Code: Select all

CMenuAbstract::CMenuAbstract(void) : CSceneAbstract()
{
	this->m_TrayManager = 0;
#ifdef OGRE_EXTERNAL_OVERLAY
	this->m_OverlaySystem = new Ogre::OverlaySystem();

	OgreBites::InputContext input;
	input.mAccelerometer = NULL;
	input.mKeyboard = this->m_Keyboard;
	input.mMouse = this->m_Mouse;
	input.mMultiTouch = NULL;

	Ogre::ResourceGroupManager::getSingletonPtr()->initialiseAllResourceGroups();
	Ogre::StringVectorPtr list = Ogre::ResourceGroupManager::getSingletonPtr()->listResourceNames("Essential");

	this->m_TrayManager = new OgreBites::SdkTrayManager("MenuTrayManager", CGame::getSingletonPtr()->m_RenderWindow, input, this);
#else
	this->m_TrayManager = new OgreBites::SdkTrayManager("MenuTrayManager", CGame::getSingletonPtr()->m_RenderWindow, this->m_Mouse, this);
#endif
}
SceneAbstract (AbstractClass for all Scene's)

Code: Select all

CSceneAbstract::CSceneAbstract(void)
	:
	m_InputManager(0),
	m_Mouse(0),
	m_Keyboard(0),
	m_SceneManager(0),
	m_Viewport(0),
	m_Camera(0),
	m_CameraMan(0)
{
	this->m_SceneManager = CGame::getSingletonPtr()->m_Root->createSceneManager(Ogre::ST_GENERIC);

	try
	{
		size_t windowHnd;
		Ogre::Root::getSingletonPtr()->getAutoCreatedWindow()->getCustomAttribute("WINDOW", &windowHnd);
	
		Ogre::String		windowHandleAsString = "";
		std::ostringstream	windowHndStr;

		windowHndStr << windowHnd;
		windowHandleAsString = windowHndStr.str();

		OIS::ParamList	lSpecialParameters;
		lSpecialParameters.insert(std::make_pair(std::string("WINDOW"), windowHandleAsString));

		this->m_InputManager	= OIS::InputManager::createInputSystem(lSpecialParameters);
		this->m_Mouse			= static_cast<OIS::Mouse*>(this->m_InputManager->createInputObject(OIS::OISMouse, true));
		this->m_Keyboard		= static_cast<OIS::Keyboard*>(this->m_InputManager->createInputObject(OIS::OISKeyboard, true));

		this->m_Mouse->setEventCallback(this);
		this->m_Keyboard->setEventCallback(this);

		Ogre::WindowEventUtilities::addWindowEventListener(CGame::getSingletonPtr()->m_RenderWindow, this);
		CGame::getSingletonPtr()->m_Root->addFrameListener(this);

		CGame::getSingletonPtr()->m_RenderWindow->setActive(true);
	}
	catch(Ogre::Exception& ex)
	{
		Ogre::LogManager::getSingletonPtr()->logMessage(Ogre::LogMessageLevel::LML_CRITICAL, "FEHLER! Fehler beim Sicherstellen des Capturing");
		Ogre::LogManager::getSingletonPtr()->logMessage(Ogre::LogMessageLevel::LML_CRITICAL, ex.getFullDescription());
	}
}
The code is running until:
this->m_TrayManager = new OgreBites::SdkTrayManager("MenuTrayManager", CGame::getSingletonPtr()->m_RenderWindow, input, this);
is called and shutting down right here.

Additionaly here's my Ogre.log:
Ogre.log

Here are some information about my system as well:
Windows 8 x64
Ogre 1.9.0 x86
Boost 1.54


Another way of getting rid off the Cursor problem is described here:
Second Solution
But this also didn't help, I'm still getting the error.
The rest of my game is running quit fine, since I can build different scenes, like Levels without any problems and can even change between two different scenes using different game states.

So it might be a 1.9.0 problem. Anybody got any information about anything new here or how I can bypass the problem?

Thanks

Max =)

//Edit:
Here's a picture of the loaded resources:
Loaded Resources
Last edited by germanmax on Thu Apr 25, 2013 5:46 pm, edited 1 time in total.
drwbns
Orc Shaman
Posts: 788
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 24

Re: Ogre 1.9.0 & SdkTrayManager

Post by drwbns »

I don't see SdkTrays.zip being loaded in your Ogre.log. I had the same issure here - http://www.ogre3d.org/forums/viewtopic.php?f=4&t=76267 but I think I ended up removing SDKTrays altogether because in my case it was loaded in the log but I still got the exception
germanmax
Gnoblar
Posts: 11
Joined: Thu Apr 25, 2013 5:21 pm

Re: Ogre 1.9.0 & SdkTrayManager

Post by germanmax »

drwbns wrote:I don't see SdkTrays.zip being loaded in your Ogre.log.
Doesn't line 309 do that?
drwbns
Orc Shaman
Posts: 788
Joined: Mon Jan 18, 2010 6:06 pm
Location: Costa Mesa, California
x 24

Re: Ogre 1.9.0 & SdkTrayManager

Post by drwbns »

Yes, it does, sorry I missed it.
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Re: Ogre 1.9.0 & SdkTrayManager

Post by dermont »

I think you have to create your OverlaySystem prior to loading resources.cfg, otherwise it appears the *.overlay files are never parsed. Try moving it to just after creating your Ogre::Root.
germanmax
Gnoblar
Posts: 11
Joined: Thu Apr 25, 2013 5:21 pm

Re: Ogre 1.9.0 & SdkTrayManager

Post by germanmax »

dermont wrote:I think you have to create your OverlaySystem prior to loading resources.cfg, otherwise it appears the *.overlay files are never parsed. Try moving it to just after creating your Ogre::Root.
Worked perfectly! Thanks!

Code: Select all

	
CGame::getSingletonPtr()->m_RenderWindow = CGame::getSingletonPtr()->m_Root->initialise(true, "Space Race");

#ifdef OGRE_EXTERNAL_OVERLAY
		CGame::getSingletonPtr()->m_OverlaySystem = new Ogre::OverlaySystem();
#endif

		CGame::getSingletonPtr()->loadingResourceConfig(g_strResourcesCFG);
using it like this now and its compiling and showing my buttons. There are some minor issues, which I will fix eventually, but that is just for the behavior of the scene. At least it does find my SdkTrays.zip

Thanks!!!
Post Reply