• Advertisement
Sign in to follow this  

Frames Per Second question

This topic is 4266 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi everyone, this is how i do my FPS count:
m_fETAccumulator += m_fET;
	m_iFrameTicker++;
	char buffer[20];
	if(m_fETAccumulator > 1000.0){
	sprintf(buffer,"FPS: %.2lf",m_iFrameTicker*1000.0/m_fETAccumulator);		
	m_Label->SetCaption(buffer);
	m_fETAccumulator= 0.0;
	m_iFrameTicker = 0;
	}


the problem i have is that i get like 62fps even though i am not doing anything but render a black screen which sounds an awful low number to me i am on a 2.5 GHz Notebook which should be enough to render a blank screen one might think:) can anyone tell me if there is something wrong with my calculation? Or is the fps-rate i get normal? thx a lot in advance

Share this post


Link to post
Share on other sites
Advertisement
Looks fine to me. You probably have vsync on, which means that you'll get the same fps as you monitors update frequency.

Share this post


Link to post
Share on other sites
thx a lot you were right:)


i tried to change it with this line in my code:

d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;


but that didnt help and i hat to switch the driversettings for it to work

now i get like 220fps with a blank screen and

like 130 with my gui rendering

Share this post


Link to post
Share on other sites
I think vsync is good, but I like to be able to use the frame_rate as a benchmark, so I don't include the flip/present() in my time tests so my code might look like

int start = clock();

RunFrame();

int frame_rate = clock() - start;

Text("frame rate: ", frame_rate);

Flip();

Share this post


Link to post
Share on other sites
Quote:
Original post by simon10k
I think vsync is good, but I like to be able to use the frame_rate as a benchmark, so I don't include the flip/present() in my time tests so my code might look like

int start = clock();

RunFrame();

int frame_rate = clock() - start;

Text("frame rate: ", frame_rate);

Flip();


You won't get correct measures this way. The GPU(assuming you are using HW acceleration) runs in parallel with the CPU, and that means that the rendering of the scene isn't nessessarily complete when RunFrame() returns.

Share this post


Link to post
Share on other sites
We get an approximation, but then again, your probably right about the GPU.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement