Loading Font on FontManager

Problems building or running the engine, queries about how to use features etc.
Post Reply
HyCe
Gnoblar
Posts: 4
Joined: Sat Feb 12, 2005 11:56 pm

Loading Font on FontManager

Post by HyCe »

hi, im started working on ogre, wich i think is great :) , and im now with a problem, wich i looked over and over here and found nothing, so i decided to post :(

i have a compile error on loading the font thru the font manager
i use this

Code: Select all

p_font = static_cast<Font*> (FontManager::getSingleton().getByName("font_name"));
but it gives this error

Code: Select all

error C2440: 'static_cast' : cannot convert from 'Ogre::ResourcePtr' to 'Ogre::Font *'
        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
is there an other way ? :?

i use Azathot
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

You must be looking at some old code / tutorials. In Azathoth you use FontPtr, not Font* ie:

Code: Select all

FontPtr p_font = FontManager::getSingleton().getByName("font_name"); 
Note the lack of a need to cast things in Azathoth.
HyCe
Gnoblar
Posts: 4
Joined: Sat Feb 12, 2005 11:56 pm

Post by HyCe »

Thank you ! :)
that's about it !
i looked here, for something changed in azathot, but didn't found anything, so i didn't knew what to do :? :roll:
Post Reply