Search Home Members Contacts
About Us
Products
Downloads
Community
Support
Pages: [1]
  Print  
Author Topic: how can I restrict the fps?  (Read 197 times)
kTecH
Customers
Community Member
*****
Posts: 85


« on: September 13, 2008, 05:21:49 PM »

Hi folks!

I want to restrict the frames per second to max 40 (no matter how fast my machin is)
Anyway it can run slower but never faster - how can I do that?

best regards

Sim
Logged
RuntimeError101
Customers
Community Member
*****
Posts: 184


« Reply #1 on: September 13, 2008, 05:27:16 PM »

You can use VSync to max the fps out at 60.
Logged
jviper
Community Member
*
Posts: 1366

Discipline in training


« Reply #2 on: September 13, 2008, 06:22:59 PM »

Better: Use TVEngine.EllapsedTime. Declare a variable counter that is a float. Each Loop increment that variable by TVEngine.EllapsedTime*0.001. When that variable gets to 1/40, render the scene, then reset the counter.

Alternatively you can create a timer event for it. Declare System.Timer object, set the interval (delay between frames so you pass (1/40) * 1000 to it for 40FPS), then write your Render Sub to handle the tick event.
« Last Edit: September 13, 2008, 06:44:21 PM by jviper » Logged

JAbstract.....Don't just imagine, make it happen!
kTecH
Customers
Community Member
*****
Posts: 85


« Reply #3 on: September 14, 2008, 03:04:13 AM »

@RuntimeError101  -> I need 40 frames;) and not every Monitor has ony 60 (some of them has 75 and so on)

jviper  -> will chetck this out
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by SMF 1.1.3 | SMF © 2006-2007, Simple Machines LLC
Seo4Smf v0.2 © Webmaster's Talks