Visual C++ CLR Project的FPS都會限制在60

Q:

我寫了一個Visual C++ CLR Project,有用到DirectX,我是用Idle的時候做DirectX的繪製,可是FPS都會鎖在60,請問一下是否有方式可以突破,這個原因是因為 DirectX或是CLR的緣故?

我放完整的程式碼在以下的網址。

Visual C++ CLR Windows Forms Application project with DirectX http://tw.myblog.yahoo.com/akira32-akira32/article?mid=483&prev=563&next=465&l=f&fid=7

	Form1(void)

	{

		InitializeComponent();

		//

		//TODO: Add the constructor code here

		//



		m_FPS=gcnew sFPS();

		m_FPS->Init();



		Application::Idle += gcnew System::EventHandler(this,&Form1::Form1_Idle);

	}

System::Void Form1::Form1_Idle(System::Object^ sender, System::EventArgs^ e)

{

while (AppStillIdle())

{

	if (d3DControlControl1!=nullptr)

	{

		d3DControlControl1->Render();

	}			



	if (m_FPS->CalculateFPS())

	{

		FPStoolStripStatusLabel->Text=L"FPS=" + m_FPS->dFPS.ToString("00.00");



		//Debug::WriteLine( m_FPS->dFPS.ToString() );

	}				

}

}

bool Form1::AppStillIdle()

{

MSG msg;

return !PeekMessage(&msg, (HWND)(Handle.ToPointer()), 0, 0, 0); 

} A: tihs 會不會是您的螢幕的垂直掃瞄頻率設定為60HZ的關係?

A: akira32 多謝,我的screen refresh rate等於60z沒錯,我終於解決了,少改以下這一行

pd3dpp->PresentationInterval=D3DPRESENT_INTERVAL_IMMEDIATE;

Comments

comments