Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

nodonnel

OpenGL Opengl Timing

This topic is 6293 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

Using only gl.h (no libraries such as glut), how can I time events in opengl? To help you understand what I mean, suppose a ball is falling to the ground. How would you make sure that it took an amount of time appropriate to gravity and other factors? How complicated is it to control the duration of, say, a cube on a screen. (e.x.: I just want to put a square on the screen, leave it there for 500 ms, and then put another object on the screen). Thanks, Nate

Share this post


Link to post
Share on other sites
Advertisement
Win32 you would make use of GetTickCount & timeGetTime (requires winmm.lib and mmsystem.h) using either multimedia timer or high performance

Share this post


Link to post
Share on other sites
Be careful with the Timer functions, they might not be as precise as you want.

In the MSDN, for GetTickCount :
" Windows 95 and later : The system timer runs at approximately 55ms. "
Means the time returned could be wrong by 1/20 second.

timeGetTime is a better choice
QueryPerformanceFrequency/QueryPerformanceCounter is another possibility.

Share this post


Link to post
Share on other sites

  • 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!