With animation i mean any animation. For example blending how do i make sure that the blend speed is the same on every PC. Intro logo blending from black fo full -> full to black. Light that is glowing etc.
for example for fade in/out you have to update a fade speed according to the actual fps.
But wont the fade go faster with that!? What i meant was to make sure the the fade will take for example 3sec.
edit
I was thinking about using “Sleep(msec)” but thats so newbish lol
[This message has been edited by GL_ZERO (edited 08-27-2003).]
Use the high performance counter to query the time needed to draw a frame and the calculate your speedfactor depending of the hpc’s counters before the frame and after the frame.
If you do that, then you’ll get a timefactor that you’ll have to use on all your animations to get the same speed on all systems.
Take a look at QueryPerformanceCounter for more info.
I think that you should look at it in a larger view.
You have the following things that effect your animation.
- Speed of the computer
- Speed of the video card
- How detailed the scene is being rendered.
Now we want to fade from one scene to another in X seconds.
So we need to come up with a rate of fade based on the above items.
To do this we can get the system time at start of rendering and after rendering.
render_start = time();
fade();
render_end = time();
render_time = render_end - render_start;
render_rate = 3 (seconds) / render_time;
render_rate is how may frames we will have to make the fade transition. A slower computer will have less frames to complete the transition vs. a faster computer will have more frames.
Hope this helps.
as PanzerSchreck said, using a timer is the way to go. so search google for QueryPerformanceCounter, and play with that a bit. nexusone solution would most likely work, but it isn’t very flexable, and is more work than u really need to do.
I personally have some predefined classes that i’ve written using QueryPerformanceCounter, and i just move those classes from one program to another, with no difficulty at all.