Crazy FPS - please help

LDV

Freshman
Joined
Dec 29, 2003
Messages
31
Hi Guys,

I wrote a short game in C# Managed DirectX, using the Direct3D interface.

In my computer and Graphic Card, the FPS is being controlled by the Screen Refresh Rate ... means 85FPS when using PresentationInterval=default.

When i'm using PresentationInterval=immidiate it gets to 300FPS !

On others computers the PresentationInterval - default doest not work !! - and i can't see the graphics ... why is it?
- and the Refresh Rate is not being used to synchronize the program. I want it always to work with PresentationInterval - default so i can use the screen refresh rate to update the screen and not to have 300FPS.

10x, LDV
 
Here's some source code I found on my book:

Do While Not Gameover
If system.Environment.TickCount - LastTick >= 1000 / DesiredFrameRate Then

<Other Rendering Code>
lastTick = System.Environment.TickCount

End If

Application.DoEvents

Loop
 
Back
Top