Posted: Tue Aug 30, 2005 8:07 am
The other user who saw the pieces move at warp speed is using SiS video as well. There may be some issue with my method of speed control not working on those cards. I'm sure it will be resolved soon, as I'm going to do some research into the best way to achieve consistent speed variations in 2d drawing. I never looked into it very far, I just tried something that looked reasonable and it seemed to work. I'm just using a combination of delays together with increments varying between 1-4 pixels of downward motion per draw. No timer, so it can probably be done much better.
Wait - I know what's happening! Those drawing commands are getting executed in spite of the delays in the code. These extra draws are permanently lost on many systems, tricking me into thinking it works. But some graphics subsystems or hyperthreaeding processors are getting at those drawing commands while my program is doing a delay() and they are coming through, resulting in the warp speed.
So, if this is anywhere near an accurate view of the problem, it should be easily solved by dumping the delays in favour of a timer which fires every so many milliseconds. Then there's no way anything gets buffered on some systems and lost on others. I'll change it tomorrow and we'll see if that makes a difference.
[edit] Ok I've looked into it and preliminary testing shows that the hi-res timer included with PBOSL is going to do the trick quite nicely. In a couple of hours I'll post a new version of the program using proper timing techniques and that should fix the warp speed issue.
Wait - I know what's happening! Those drawing commands are getting executed in spite of the delays in the code. These extra draws are permanently lost on many systems, tricking me into thinking it works. But some graphics subsystems or hyperthreaeding processors are getting at those drawing commands while my program is doing a delay() and they are coming through, resulting in the warp speed.
So, if this is anywhere near an accurate view of the problem, it should be easily solved by dumping the delays in favour of a timer which fires every so many milliseconds. Then there's no way anything gets buffered on some systems and lost on others. I'll change it tomorrow and we'll see if that makes a difference.
[edit] Ok I've looked into it and preliminary testing shows that the hi-res timer included with PBOSL is going to do the trick quite nicely. In a couple of hours I'll post a new version of the program using proper timing techniques and that should fix the warp speed issue.