Overlaymanager pointer?

Problems building or running the engine, queries about how to use features etc.
Post Reply
User avatar
LordMyth
Gremlin
Posts: 181
Joined: Thu Jan 06, 2005 10:19 pm
Location: Belgium
Contact:

Overlaymanager pointer?

Post by LordMyth »

Ogre::OverlayManager* OverlayManager = Ogre::OverlayManager::getSingleton();
When doing this I get an error:
MythApp.h:144: error: cannot convert `Ogre::OverlayManager' to ` Ogre::OverlayManager*' in initialization

Is this fixed in the CVS?
Have a kiss from me!
Gentoo Linux on AMD64 3200+
NForce4 Chipset
Dual Channel DDR 2x512MB
PCX 16 GeForce 6600 256MB
User avatar
pjcast
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2543
Joined: Fri Oct 24, 2003 2:53 am
Location: San Diego, Ca
x 2
Contact:

Post by pjcast »

use getSingletonPtr() or use the & operator on the result of getSingleton()
Have a question about Input? Video? WGE? Come on over... http://www.wreckedgames.com/forum/
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

Actually it never was broken. use getSingletonPtr().
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
LordMyth
Gremlin
Posts: 181
Joined: Thu Jan 06, 2005 10:19 pm
Location: Belgium
Contact:

Post by LordMyth »

Oh, OK thanks! What does the getSingleton() function do?
Have a kiss from me!
Gentoo Linux on AMD64 3200+
NForce4 Chipset
Dual Channel DDR 2x512MB
PCX 16 GeForce 6600 256MB
User avatar
DWORD
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 1365
Joined: Tue Sep 07, 2004 12:43 pm
Location: Aalborg, Denmark
Contact:

Post by DWORD »

It returns a reference instead.
User avatar
bal
Greenskin
Posts: 100
Joined: Thu Dec 09, 2004 7:29 pm
Location: Geluwe, Belgium

Post by bal »

LordMyth wrote:Oh, OK thanks! What does the getSingleton() function do?
It return a reference to the class instead of a pointer.
User avatar
LordMyth
Gremlin
Posts: 181
Joined: Thu Jan 06, 2005 10:19 pm
Location: Belgium
Contact:

Post by LordMyth »

Ahh! yes of course... I'm stupid these days :lol:
Hmm.. Wonder if it would look better if I accessed things with App::SceneManager.blabla() instead of App::SceneManager->blabla();
Have a kiss from me!
Gentoo Linux on AMD64 3200+
NForce4 Chipset
Dual Channel DDR 2x512MB
PCX 16 GeForce 6600 256MB
User avatar
haffax
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 4823
Joined: Fri Jun 18, 2004 1:40 pm
Location: Berlin, Germany
x 8
Contact:

Post by haffax »

getSingleton() has an advantage compared to getSingletonPtr(), imho: You get an expressive assertion failed excepetion, when it isn't initialized. getSingletonPtr() will only give you a null pointer.
team-pantheon programmer
creators of Rastullahs Lockenpracht
User avatar
LordMyth
Gremlin
Posts: 181
Joined: Thu Jan 06, 2005 10:19 pm
Location: Belgium
Contact:

Post by LordMyth »

Ow! Cool! I'll change everything to references then...
Have a kiss from me!
Gentoo Linux on AMD64 3200+
NForce4 Chipset
Dual Channel DDR 2x512MB
PCX 16 GeForce 6600 256MB
Post Reply