Reply to Re: Dink Smallwood v1.08 Beta 3
If you don't have an account, just leave the password field blank.
December 31st 2005, 01:43 AM
toa
"My thinking is if we limit the buffer to 2 or 3 keystrokes, or flush it at appropriate times {perhaps fflush(stdin) in stdio}, then both of these issues might be resolved."
Input streams cannot be flushed. (Flushing invloves commiting buffers to disk and only works on output.) There is probably a special function provided by Windows or DirectInput to clear the input buffer.
However, we end up with even more problems: keys get dropped all over the place, requiring the player to hold the key down for a duration of time so that the key hits the delay between clearing and reading, which might be a smaller delay than between reading and clearing.
Input streams cannot be flushed. (Flushing invloves commiting buffers to disk and only works on output.) There is probably a special function provided by Windows or DirectInput to clear the input buffer.
However, we end up with even more problems: keys get dropped all over the place, requiring the player to hold the key down for a duration of time so that the key hits the delay between clearing and reading, which might be a smaller delay than between reading and clearing.