//dInputから呼ばれます。 //特定のキーを押されることによって、低速等のフラグを変更します。 void SetFPS(BYTE *diks) { //------------------------------FPS計測 static LARGE_INTEGER lastCount = {0}; static LARGE_INTEGER currCount = {0}; static DWORD FPSCount = 0; static float realFPS = 0.0f; QueryPerformanceCounter(&currCount); FPSCount++; if(currCount.QuadPart - lastCount.QuadPart >= FrequencyBase.QuadPart){ //1秒間より多かったら if(currCount.QuadPart != 0){ realFPS = (float)(FPSCount * (double)FrequencyBase.QuadPart / (currCount.QuadPart - lastCount.QuadPart)) ; //FPS計算 } lastCount = currCount; FPSCount = 0; Start_SetFPS(); } //------------------------------FPS変更 //最後に押された数字ボタンを取得 int iFPSindex = getUseFPSIndex(diks); INITIALIZE init; GetInitData(&init); float fUseFPS = 60.0f; //FPSをセット fUseFPS = changeFPS(diks,&(init.fFPS[iFPSindex])); SetInitData(&init); pFrequency->QuadPart = (LONGLONG)(FrequencyBase.QuadPart * 60 / (double)fUseFPS ); setFPSString(fUseFPS,realFPS); return; }
void IrisViewport::SetInitData(const IIrisRect *rect){ SetInitData(((IrisRect*)rect)->x, ((IrisRect*)rect)->y, ((IrisRect*)rect)->width, ((IrisRect*)rect)->height); }
void IrisViewport::SetInitData(const IrisRect *rect){ SetInitData(rect->x, rect->y, rect->height, rect->width); }