• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

C++ timing issues.

Joined
Feb 8, 2005
Messages
1,675 (0.24/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

  • Particle Man.zip
    582.5 KB · Views: 327
Last edited:

Oliver_FF

New Member
Joined
Oct 15, 2006
Messages
544 (0.08/day)
Processor Intel q9400 @ stock
Motherboard Lanparty P45-T2RS
Cooling Zalman CNPS-9500
Memory 8GB OCZ PC2-6400
Video Card(s) BFG Nvidia GTX285 OC
Storage 1TB, 500GB, 500GB
Display(s) 20" Samsung T200HD
Case Antec Mini P180
Audio Device(s) Sound Blaster X-Fi Elite Pro
Power Supply 700w Hiper
Software Ubuntu x64 virtualising Vista
Joined
Feb 8, 2005
Messages
1,675 (0.24/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
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:
Top