* Tuomas Huhtanen
> I'd be really interested to see this scheme in action...

anyone may feel free to drop by <URL:
http://www.treemenu.com/morten/timer-lib/ > download the .zip and play
with the code to see if it works or not.

> Depending how you wan't to synchronize your threads, trusting the
> timerevents can be quite dangerous. If a smooth time dependent animation is
> wanted, I would propably snap to some initial date value instead of trusting
> the settimeout/setinterval.

the Date() object should be fairly accurate since its creation doesn't
take any mentionable time.  I don't really see how you can create
something that'll work with it though, since the only tools you have
for forking (which is required to get the screen update) is
setTimeout() and setInterval().  so regardless of how you do things
you won't get clock ticks below 55ms on 95/98-machines.

of course, given my non-existant game programming knowledge I cannot
say whether having that 55ms tick is something you can work with or
not though.

> An interesting point that I noticed was that using the setTimeout seems to
> be much more reliable than using the setInterval. (I don't deny the
> possibility of bugs in my test code, but I of course doubt it :)

I'm not sure I agree with you regarding setTimeout().  if you read
<URL: http://www.webreference.com/dhtml/column28/part-4.html > and
look at the test results on the page before it, you'll see that it's
rather difficult to predict the overall results of a tail-end
setTimeout() call.  setInterval() gave much more consistant results,
particularly when you check the various systems (Mac vs Linux vs NT,
for instance).

> BTW, The shortest time the timeout could run was 10ms (Because the 10ms
> delay explained before), which is much more than the 40hz. So is my OS just
> so good, or is it after all a rendering dependant problem (No rendering done
> during this test)?

it's the OS.  the problem with speed of animation using a single
setTimeout()/setInterval() thread to delay it only exists on Windows 95/98.


Morten!

-- 
"...a liquid which was almost, but not quite, entirely unlike tea."
  My opinions are not necessarily those of my provider,
  not necessarily mine, and probably not necessary.


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to