Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • 2 weeks later...
Posted

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

My VB.NET Game Programming Tutorial Site (GDI+, Direct3D, Tetris [coming soon], a full RPG.... you name it!)

vbprogramming.8k.com

My Project (Need VB.NET Programmers)

http://workspaces.gotdotnet.com/ResolutionRPG

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...