예제 #1
0
long CConvert::GetEncodeFramerate(void)
{
	// simplistic fps formula. A more accurate one will
	// be built into the encoder soon

	if (m_pGraph == NULL)
	{
		// if the mpegstats is gone, then we return the average fps
		return (long)((double)GetFramesEncoded() / (double)GetTimeElapsed());
	}
	else
	{
		long n = GetFramesEncoded();
		long fps =  n - m_nLastEncodedFrameCount;
		m_nLastEncodedFrameCount = n;
		return fps;
	}
}
예제 #2
0
//------------------------------------------------------------------------------
void
CEnvMapWaterEffect::OnFrameUpdate()
{
	CWaterEffect::OnFrameUpdate();

	float deltaTime = GetTimeElapsed() * 0.001f;
	// update texture coordinate offsets
	m_WaveOffset.x += m_WaveSpeed[0].x * deltaTime;
	m_WaveOffset.y += m_WaveSpeed[0].y * deltaTime;
	m_WaveOffset.z += m_WaveSpeed[1].x * deltaTime;
	m_WaveOffset.w += m_WaveSpeed[1].y * deltaTime;
	// repeate in range [0,1] or [-1,0]
	if (m_WaveOffset.x >= 1.0f || m_WaveOffset.x <= -1.0f)
		m_WaveOffset.x = 0.0f;
	if (m_WaveOffset.y >= 1.0f || m_WaveOffset.y <= -1.0f)
		m_WaveOffset.y = 0.0f;
	if (m_WaveOffset.z >= 1.0f || m_WaveOffset.z <= -1.0f)
		m_WaveOffset.z = 0.0f;
	if (m_WaveOffset.w >= 1.0f || m_WaveOffset.w <= -1.0f)
		m_WaveOffset.w = 0.0f;
}
예제 #3
0
파일: Clock.cpp 프로젝트: Ziple/kT
 void KT_API Clock::Stop()
 {
     myRefTime = GetTimeElapsed();
 }