Sign in to follow this  
namingway

displaying variables in SDL

Recommended Posts

I've written a basic frames per second formula and I'm wondering how to make it appear on the screen since message = TTF_RenderText_Solid( font, "text", textColor ); the text to display is constatn so a frames per second counter wont go. Is there an alternative?

Share this post


Link to post
Share on other sites
So, your question is more about converting a floating-point value to a string.

Depending on your language, you can use:
- In C, snprintf
- In C++, stringstream or boost::lexical_cast

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this