Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

When playing a Video in my OpenGL Game (e.g. startup video), I want to sync it with my delta time. What is the delta time and how to use here.

Do I need to sync with the delta time (and how?) or is there another way to sync my video? I'm using my own video file reader.

share|improve this question
4  
Unless the video is silent, you're probably better off synchronizing the video playback with the audio track. –  Adam May 27 '13 at 9:42

1 Answer 1

The Delta Time is simply a standarized "clock time", which should be always be 1Hz or 1tick/1second. Some clocks can be to fast or too slow so a precise Rolex watch will show the exact delta time while a cheap one will lie a bit...

The CPU's are referred to as clocks (for eg. the overclocking). Depending on their "clock rate" some can even be over 5Ghz, so they can generate 5,000,000,000 "clock beats" per second. If you do not use the delta time in your video player, your computers clock will frames of the video 5Bil x faster then it should. So it needs to be downscaled to a human-friendly time measurement unit. Would You use miles to measure the height of an ant - You can, but why would you?

Older games for Windows 95, didn't use the delta time but were scaled for the cpu's at that time. If you load a 25 year old game into a new computer wont be able to play it, as it was meant to be used on an Intel 80386 or something similar which had the clockrate of 40Mhz. So the game would play 125x faster on the new PC with 5GHz clock.

Read about the deltatime and the clock rate on Wikipedia, and before you script anything which has a time constant keep in mind that if it is meant for different CPU's you always have to use the Delta Time. :)

http://en.wikipedia.org/wiki/clock_rate

http://en.wikipedia.org/wiki/Delta_timing

share|improve this answer
    
It can end worse than simply being "too fast". ;) I remember when I tried to play the classic Nibbles.bas on my 133 MHz Pentium - it simply crashed (or more specific: stopped with a interpreter error) due to dividing by 0: The game tried to measure the processor's speed and then used that value to calculate speeds. Only downside has been the fact a reasonably fast machine got it to cause a "divide by zero" error. –  Mario Mar 28 '13 at 0:33
    
Some very old games may work on modern systems if they are vsynced or have a way to turn on vsync. If simulation have to wait for screen refresh that will limit the max FPS they may reach. –  Hatoru Hansou Jun 26 '13 at 1:28
1  
I don't think this actually answers the question, which is about playing videos, not the merits of time-based over frame-based animation. –  Nathan Reed Jun 26 '13 at 3:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.