• Advertisement
Sign in to follow this  

FTGL-Problems again

This topic is 2979 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey Guys, Don't know if this is the right place to post this, but if it's not plz just move the topic. Now to my problem: I finally got FTGL to work (yes, i managed the linking stuff ;) ), but now i'm running into the next problem. ( I guess it's actually pretty simple, but i just can't figure it out ) The only thing i'm trying to do is to show the position of the player in the tilegrid (something like "tile x/y: 1/2"), but I don't know how to do that with the render-function. Is there some way to use that function with something other than const chars? I first thought it would work just like font.Render("text %d", 1), but obviously this does'nt do it at all. I hope you can help me.

Share this post


Link to post
Share on other sites
Advertisement
create a buffer on the stack (or heap, whichever is cleaner) and pass that:


char buffer[256]; //make sure it's long enough
int myIntVar = 1;

sprintf( buffer, "text %d", myIntVar ); //use snprintf instead cause it's safer

font.Render( buffer );



Or better, use std::string instead. I'm just too lazy to look up the syntax to retrieve the buffer from a std::string.

-me

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement