From: Virgil W. <vir...@ra...> - 2000-08-31 23:44:13
|
> Really ? > I thought that even 50ms precision should be enough > -> about 20 fps (more or less :-) ! The visual quality of using the more precise clock is pretty apparent in some situations. The human eye is pretty good at catching "glitches" in anticipated motion. Pretty much any commercial game uses more accurate timing. > > Well - anyway, if you really have to be that precisous, > i wonder, how you handle the _very_ unprecise Thread.sleep() call ? > Because you are guaranteed to be woke up in the right time ... Because I time the sleep too. What matters is how much time elapsed since the last update, Thread.sleep/Thead.yield and all. The only reason to sleep/yield at all is to prevent thread starvation. So naturally, you have to take a time stamp, sleep a little, take another timestamp and repeat. > > > (For the curious, the Magician Java opengl crap has a percision timer > > call... it's pretty each to do, but one might argue that it has nothing to > > do with opengl) > > > > Ok ... so why don't you offer your native function > to GL4Java ? Because I'd have to make it work on windows, unix and mac:) (windows and unix are no problem,btw) Also, if I'm going to go to all of this trouble, then I'd probably offer more than just a few timing calls. For instance, I use native calls to change the screen resolution and make the fullscreen window a top level window (so it would be possible to do full screen things at some resolution other than what the user's desktop is set to). > > If the implementation uses the Unix like time functions, > I guess we can add it for ALL OS/platforms ! > I love to add it into the next release, if you are fast :-) enough .. > Currently I am working for: > - Linux*, Solaris-, SGI/Irix*, HP-UX- > - MacOS- > - Win32* > ports of GL4Java ! > (* well done, - some platform specific problems, but under work) > > Well, please do not make OS depended stuff - if possible. > Your application should run on all of our GL4Java platforms, right ? Nope :) to be honest, I could care less if anyone on HPUX can play this game or not. If I'm going to care about HPUX then I'm also going to care about AIX... which isn't in your list. By the time I'm done, I'm also probably going to be using DirectInput on windows (so I can poll the keyboard directly and use a force feedback joystick). I might also use directsound.... So, a native timing function is the least of my concern. > So just try to minimize special native things, I hear you.... and I do just as any person might (its much easier to manage). > and offer them (the native atoms) to the gl4java project - no problem ! Virgil |