⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fps_counter.cpp

📁 it is a visual c++ file
💻 CPP
字号:
//////////////////////////////////////////////////////////////////////////////////////////
//	FPS_COUNTER.cpp
//	functions to calculate frames per second
//	Downloaded from: www.paulsprojects.net
//	Created:	20th July 2002
//
//	Copyright (c) 2006, Paul Baker
//	Distributed under the New BSD Licence. (See accompanying file License.txt or copy at
//	http://www.paulsprojects.net/NewBSDLicense.txt)
//////////////////////////////////////////////////////////////////////////////////////////	
#include <windows.h>
#include "LOG.h"
#include "FPS_COUNTER.h"

extern LOG errorLog;

void FPS_COUNTER::Update(void)
{
	//keep track of time lapse and frame count
	time = timeGetTime()*0.001f;							//get current time in seconds
	++frames;												//increase frame count
		
	if(time-lastTime>1.0f)									//if it has been 1 second
	{
		fps		= frames/(time-lastTime);					//update fps number
		lastTime= time;										//set beginning count
		frames	= 0L;										//reset frames this second
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -