开发者

How can I print the frames per second on my window's title in glut?

开发者 https://www.devze.com 2023-02-02 01:37 出处:网络
I tried this: char window_title[20]; sprintf(window_title, \"%f\", fps); glutCreateWindow(window_title);

I tried this:

    char window_title[20]; 
    sprintf(window_title, "%f", fps);

    glutCreateWindow(window_title);

And isn't updating (remains 0) I checked fps 开发者_如何学编程being updated via printf.

How can I update the title?


Call glutSetWindowTitle with the fps after you compute it.

0

精彩评论

暂无评论...
验证码 换一张
取 消