How to display framerate in window title?
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
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
精彩评论