SFML community forums

Help => Window => Topic started by: Auron on August 05, 2009, 04:27:33 am

Title: Show FPS In Title Bar Window
Post by: Auron on August 05, 2009, 04:27:33 am
Hey Guys,

I was wondering if there was a way to show the FPS or Framerate in the title bar of the window? I've seen it done in other libraries and engines, but I have just started using SFML. Any exmaples, please?
Title: Show FPS In Title Bar Window
Post by: klusark on August 05, 2009, 06:15:05 am
There currently is no way to change the window title.
Title: Show FPS In Title Bar Window
Post by: Auron on August 05, 2009, 07:16:54 am
So you're saying that you can't display the framerate or FPS in the title bar window. Only the name of the window.
Title: Show FPS In Title Bar Window
Post by: Laurent on August 05, 2009, 07:49:28 am
Once you've created the window you can't change its title.

If you want to quickly display the current FPS you can use FRAPS.
Title: Show FPS In Title Bar Window
Post by: Auron on August 05, 2009, 05:49:26 pm
Ah, ok, thanks.
Title: Show FPS In Title Bar Window
Post by: Astrof on August 05, 2009, 09:32:55 pm
Or if you really want to you can get the window handle and change the title yourself...but that would require work.
Title: Show FPS In Title Bar Window
Post by: Auron on August 06, 2009, 05:27:56 am
I just wanted to display the FPS in the title bar, but if there's not a lot that can be done about, then its no biggie.
Title: Show FPS In Title Bar Window
Post by: Sirt on August 24, 2009, 08:20:43 am
It sounds like a neat idea though having an fps counter in the titlebar.

You could create an sf::RenderWindow without a titlebar,
then blit your image of a titlebar to the top of the screen every frame while also outputing an sf::String anywhere in that titlebar.

(just a thought).
Title: Show FPS In Title Bar Window
Post by: klusark on August 24, 2009, 11:28:42 pm
Quote from: "Sirt"
It sounds like a neat idea though having an fps counter in the titlebar.

You could create an sf::RenderWindow without a titlebar,
then blit your image of a titlebar to the top of the screen every frame while also outputing an sf::String anywhere in that titlebar.

(just a thought).


That would only work for one platform. Imagine running a program on linux and having the windows xp titlebar showing up.
Title: Show FPS In Title Bar Window
Post by: Hiura on August 25, 2009, 08:00:42 am
You can have a style sheet file to do the job.
Title: Show FPS In Title Bar Window
Post by: e_barroga on August 31, 2009, 07:48:42 am
Quote from: "Laurent"
Once you've created the window you can't change its title.

If you want to quickly display the current FPS you can use FRAPS.


Will there be a future method to change the title? If not, why?
Title: Show FPS In Title Bar Window
Post by: Laurent on August 31, 2009, 08:20:25 am
Quote
Will there be a future method to change the title?

I still don't know ;)
Title: Show FPS In Title Bar Window
Post by: Auron on September 28, 2009, 07:58:21 am
Wow, I'm surpirsed this thread still kept going. I haven't used SFML in awhile, and forgot, well pretty much everything. Although I'm now thinking of starting up again.