Jump to content
  • Advertisement
Sign in to follow this  
nucleus

Timed rendering of lines

This topic is 4068 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello. Im trying to simulate a projectiles trajectory in C++ (with opengl). problem is, the formulas used for calculating the points along the trajectory have a time variable in them. i figured i need to get the time in milliseconds, i just cant find a way to do this. i tried using the sleep function, but it is not very accurate, and behaves oddly. i thought of using the glutTimerFunc but setting up a timer and using a callback function a thousnd time a second inst a very good way. could anyone help me? im using linux, btw... [Edited by - nucleus on June 26, 2007 4:15:27 PM]

Share this post


Link to post
Share on other sites
Advertisement
You could use ftime(float&) or glutGet(GLUT_ELAPSED_TIME) to get the elapsed time in milliseconds. I'm not sure why you would use sleep(int), since that function basically says "Ignore this thread for x seconds."

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!