Sign in to follow this  
Rozik

Frames Per Second question

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this