FPS制御
Posted: 2010年5月01日(土) 14:22
FPS制御しようとして、龍神録プログラミングの館の43「きっちりFPS~」の
コードを入れたら、エラーが出ました。どこがおかしいでしょうか?
環境はBCCDeveloperです。少し長いので要らないところは省いてます
エラー:無効な間接参照(関数 draw_fps(int,int) )
関数でないものを呼び出している(関数 __stdcall WinMain(HINSTANCE__ *,HINSTANCE__ *,char
*,int) )
コードを入れたら、エラーが出ました。どこがおかしいでしょうか?
環境はBCCDeveloperです。少し長いので要らないところは省いてます
int fps_count,count0t;
int f[FLAME];
int color=GetColor(255,255,255);
double ave;
void fps_wait(){
int term,i,gnt;
static int t=0;
if(fps_count==0){
if(t==0)
term=0;
else
term=count0t+1000-GetNowCount();
}
else
term = (int)(count0t+fps_count*(1000.0/FLAME))-GetNowCount();
if(term>0)
Sleep(term);
gnt=GetNowCount();
if(fps_count==0)
count0t=gnt;
f[fps_count]=gnt-t;
t=gnt;
if(fps_count==FLAME-1){
ave=0;
for(i=0;i<FLAME;i++)
ave+=f;
ave/=FLAME;
}
fps_count = (++fps_count)%FLAME ;
}
//x,yの位置にfpsを表示
void draw_fps(int x,int y){ //多分この行がおかしい
if(ave!=0){
DrawFormatString(x, y,color[0],"[%.1f]",1000/ave);
}
return;
}エラー:無効な間接参照(関数 draw_fps(int,int) )
関数でないものを呼び出している(関数 __stdcall WinMain(HINSTANCE__ *,HINSTANCE__ *,char
*,int) )