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

C++ timing issues.

Discussion in 'Programming & Webmastering' started by GSG-9, Aug 10, 2008.

  1. GSG-9

    GSG-9

    Joined:
    Feb 8, 2005
    Messages:
    1,678 (0.49/day)
    Thanks Received:
    144
    Location:
    Minneapolis, Mn
    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.

    Attached Files:

    Last edited: Aug 10, 2008
  2. Oliver_FF

    Oliver_FF New Member

    Joined:
    Oct 15, 2006
    Messages:
    546 (0.19/day)
    Thanks Received:
    65
  3. DanTheBanjoman SeƱor Moderator

    Joined:
    May 20, 2004
    Messages:
    10,553 (2.84/day)
    Thanks Received:
    1,383
    system.threading.thread.sleep() in .NET, so look at threading things?
  4. GSG-9

    GSG-9

    Joined:
    Feb 8, 2005
    Messages:
    1,678 (0.49/day)
    Thanks Received:
    144
    Location:
    Minneapolis, Mn
    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 :)

    I dont have a .NET compiler and am not sure how to utilize that function.
    Last edited: Aug 11, 2008

Currently Active Users Viewing This Thread: 1 (0 members and 1 guest)

Share This Page