一瞬止まってそしてすぐに移動するような現象がおきてしまいます。
FPSの様子も56から46まで落ちる現象(処理落ち?)が起きます。
どの辺を直せばよいのでしょうか?
static DWORD before_time,befoer,Count0t;
DWORD now_time,t;
static int count=0;
long long IdleTime =0;
TCHAR buff[100];
DWORD cnt;
static long long surplus_Time=0;
now_time=timeGetTime();
if(!befoer_time)
befoer_time=timeGetTime();
if(!befoer)
befoer=timeGetTime();
surplus_Time+=1000/FPS-(long long)(now_time-befoer_time);
if(surplus_Time<=0){
IdleTime =0;
}
else
{
if(IdleTime!=surplus_Time)
IdleTime=surplus_Time;
surplus_Time=0;
++count;
}
if(IdleTime>0)
Sleep(IdleTime);
wsprintf(buff,_T("%u\n"),(now_time-before_time)+IdleTime);
OutputDebugString(buff);
before_time=timeGetTime();
cnt=timeGetTime();
t=cnt-before;
if(t>=1000)
{
cnt=t;
FpsDraw=count*1000/t;
count=0;
before=timeGetTime();
}足りないところがあれば
補足します。よろしくおねがいします。