if(abs(box2.centerX - box1.centerX) < box2.w/2 + box1.w/2
&& abs(box2.centerY - box1.centerY) < box2.h/2 + box1.h/2)
{
TextOut(hdc, 10, 10, "접촉", 4);
}
void Framework::UpdateFPS()
{
static DWORD FrameCnt = 0;
static float TimeElapsed = 0;
static DWORD lastTime = timeGetTime();
DWORD currTime = timeGetTime();
float timeDelta = (currTime - lastTime)*0.001f;
FrameCnt++;
TimeElapsed += timeDelta;
if(TimeElapsed >= 1.0f)
{
m_fFPS = (float)FrameCnt / TimeElapsed;
TimeElapsed = 0.0f;
FrameCnt = 0;
}
lastTime = currTime;
}
'개발 시점의 넉두리 > [개발전]' 카테고리의 다른 글
GetAsyncKeyState() 함수와 GetKeyState() 함수 (0) | 2009.04.07 |
---|---|
Rotate(BMP) (0) | 2009.04.04 |
참조 소스(랜덤) (0) | 2009.04.04 |
참조 소스[D3D] FPS 성능 부분 (0) | 2009.04.04 |
참조 파일 _2 (0) | 2009.04.03 |