• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.
  • The forums have been upgraded with support for dark mode. By default it will follow the setting on your system/browser. You may override it by scrolling to the end of the page and clicking the gears icon.

C++ timing issues.

Joined
Feb 8, 2005
Messages
1,675 (0.22/day)
Location
Minneapolis, Mn
System Name Livingston
Processor i7-4960HQ
Motherboard macbook prp retina
Cooling Alphacool NexXxoS Monsta (240mm x 120mm x 80mm)
Memory 16Gb
Video Card(s) Zotac Arctic Storm Nvidia 980ti
Display(s) 1x Acer XB270HU, 1x Catleap, 1x Oculus
Benchmark Scores http://www.3dmark.com/fs/770087
Hello everyone, I have a program that has been sitting around for a few months and I have some issues I cant seem to fix on my own. The program is a platformer using GLUT/Open|GL. My problem is I cannot get my program to run a certain number of times (20 times a second is what i would like) and then wait. Right now it goes as fast as your computer will let it, causing the game to end before you can tell whats going on (At least on my desktop, on my laptop its playable.)

I tried using Sleep() but cannot seem to get the right .h files in place.
I also do NOT want to use pause.

If anyone can help I would greatly appreciate it.

The project is below...


EDIT ParticleMan.ccp is the main file and the one that needs a system.
 

Attachments

Last edited:
This should help:
http://www.gamedev.net/community/forums/topic.asp?topic_id=475529

Oh, I think the Sleep() function is defined in dos.h ... maybe...

That might help, im going to try it when I get home, but will that actually cause it to process the game at a slower speed? I will see :)

system.threading.thread.sleep() in .NET, so look at threading things?

I dont have a .NET compiler and am not sure how to utilize that function.
 
Last edited:
Back
Top