Problem setting up CGUITTFont

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
tronfortytwo
Posts: 5
Joined: Wed Nov 01, 2017 7:17 pm

Problem setting up CGUITTFont

Post by tronfortytwo »

I am trying to set up CGUITTFont but I get a building error.
I downloaded CGUITTFont 1.7.2 and IrrUstring.h, I added them to my project.
My system is a Debian x86_64 and my compiler is gcc 7.1.
My Irrlicht version is 1.8.4.
When I try to compile them I get:

Code: Select all

 
tronfourtytwo@debian:~/Desktop/TatoProject/src$ make
g++ -c CGUITTFont.cpp -I/usr/include/freetype2/
CGUITTFont.cpp: In member function ‘virtual irr::video::IImage* irr::gui::CGUITTFont::createTextureFromChar(const uchar32_t&)’:
CGUITTFont.cpp:923:28: error: no matching function for call to ‘irr::video::ITexture::lock(bool)’
  void* ptr = tex->lock(true);
                            ^
In file included from /usr/include/irrlicht/IVideoDriver.h:10:0,
                 from /usr/include/irrlicht/IQ3Shader.h:11,
                 from /usr/include/irrlicht/IAnimatedMeshMD3.h:9,
                 from /usr/include/irrlicht/irrlicht.h:58,
                 from CGUITTFont.cpp:31:
/usr/include/irrlicht/ITexture.h:127:16: note: candidate: virtual void* irr::video::ITexture::lock(irr::video::E_TEXTURE_LOCK_MODE, irr::u32)
  virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) = 0;
                ^~~~
/usr/include/irrlicht/ITexture.h:127:16: note:   no known conversion for argument 1 from ‘bool’ to ‘irr::video::E_TEXTURE_LOCK_MODE’
CGUITTFont.cpp: In member function ‘virtual irr::core::array<irr::scene::ISceneNode*> irr::gui::CGUITTFont::addTextSceneNode(const wchar_t*, irr::scene::ISceneManager*, irr::scene::ISceneNode*, const irr::video::SColor&, bool)’:
CGUITTFont.cpp:1080:92: warning: ‘void irr::scene::IMeshManipulator::scaleMesh(irr::scene::IMesh*, const vector3df&) const’ is deprecated [-Wdeprecated-declarations]
     mani->scaleMesh(meshcopy, vector3df((f32)letter_size.Width, (f32)letter_size.Height, 1));
                                                                                            ^
In file included from /usr/include/irrlicht/irrlicht.h:112:0,
                 from CGUITTFont.cpp:31:
/usr/include/irrlicht/IMeshManipulator.h:125:25: note: declared here
   _IRR_DEPRECATED_ void scaleMesh(IMesh* mesh, const core::vector3df& factor) const {return scale(mesh,factor);}
                         ^~~~~~~~~
Makefile:36: recipe for target 'CGUITTFont.o' failed
make: *** [CGUITTFont.o] Error 1
 
Thanks for your help! :D
CuteAlien
Admin
Posts: 9628
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Problem setting up CGUITTFont

Post by CuteAlien »

Yeah, looks like that code is for Irrlicht 1.7.
I modified some TTF class (not sure if same as you didn't link to yours, but shouldn't matter) and you can find it at https://bitbucket.org/mzeilfelder/irr-p ... -micha/src
Copy the 2 CGUITTFont files (also ttf.cpp an example for using it, thought ignore the ride-side of screen when running that - that's just showing something I still need to debug).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
MartinVee
Posts: 139
Joined: Tue Aug 02, 2016 3:38 pm
Location: Québec, Canada

Re: Problem setting up CGUITTFont

Post by MartinVee »

You could also download the trunk version, which is slight update from the 1.7.2 version of the post I pointed you to (sorry for the confusion, I should have check that it didn't point to the latest version).

Here's a link to the trunk version.
tronfortytwo
Posts: 5
Joined: Wed Nov 01, 2017 7:17 pm

Re: Problem setting up CGUITTFont

Post by tronfortytwo »

Thank you both for your quick response. Using both the one from the linked repo or from trunk branch I got it to compile successfully with latest irrlicht. :D
Post Reply