开发者

How to display framerate in window title?

开发者 https://www.devze.com 2023-03-08 20:41 出处:网络
I think this is going to be an easy one for you guys :) I am trying to get FPS displayed in the window title in my Dire开发者_如何学Goctx application (written in C++). I do not really know how to do

I think this is going to be an easy one for you guys :)

I am trying to get FPS displayed in the window title in my Dire开发者_如何学Goctx application (written in C++). I do not really know how to do this as my app assigns title in this manner

How to display framerate in window title?

any ideas how to do this (so that I can see the FPS when I minimise my app) ?


I think you can use SetWindowText() to accomplish this, e.g.:

HWND window = CreateWindow(windowClass.lpszClassName, title, WS_OVERLAPPEDWINDOW, x, y, width, height, GetDesktopWindow(),NULL,windowClass.hInstance,NULL);

... then later ...

SetWindowText(window, "XXXX FPS");

See: http://msdn.microsoft.com/en-us/library/aa302340.aspx#win32map_windowfunctions

0

精彩评论

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