Player input: buffered or imediate?
The real question you have to ask yourself it, am I interested in the button BEING down or the button GOING DOWN (but not mattering whether it went back up yet).
Somethings, like entering a player name, is more suited to buffered input because you don't really care whether the button is down or up right now (ignoring holding down a key to repeat it). All you care is whether it was pressed. With immediate input, even with 60 fps, will miss some keystrokes when a moderate speed typist types some text in. Also, buffered input is important when the order of events is important. If you game sees, with immediate input, an 'A' and a 'K' currently down, which does it use first?
Anyway, just providing a different opinion than above.
- Splat
So its almost impossible to stay at a diagnol. Now with buffered input i dont get this problem or atleast not with the sdk samples i have tryed it on. Since i have yet to get buffered input working.

I am using DirectX7 and Direct Input in immediate mode for my keyboard. I am doing a first person shooter demo/experimentation and am checking the keyboard before each frame gets rendered. My problem lies in the fullscreen mode where the inputs lag before and after I press keys. In windowed mode there is no problem but when I switch to fullscreen and press a key nothing happens for half-second then while holding down the key I move forward then I let go of the key and am still moving forward then after a second or two I stop. I am using D3DX util. library and was wondering if anyone out there had similar experience with this. I don't understand why there is a difference between windowed and fullscreen using the same code base. I appreciate any input. Thank you in advance.
SleepEx(1, TRUE);
Your problem is caused by video drivers that cheat on benchmarks. This solves that problem...
hr = pDIKeyboard->GetDeviceState(256, keys);
SleepEx(15);
I don't have to slow down the code in windowed mode. Actually a value higher than 15 also works, but if it's 14ms then I have the same problem. So, in a nutshell I read keyboard state, then slow down code for 15ms then check for keys pressed if any, then I start timer by timeGetTime(), then I call my render function and after that I retrieve time using timeGetTime again to see how long the rendering took and calculate frames per second. I don't see why I must be slowing down the code after I retrieve input values.
All this code is located in the message loop and is executed when there are no messages in the window queue. Any ideas?
Sorry for all the questions but none of my game books fully address this.
I am using win98, cyrix 233Mhz, vc++ 6.0std. and DX7 and DX7 Direct input interfaces. I program on 3DLabs, Permedia2 chip, video card is called Graphic Blaster Exxtreeme from Creative Labs with latest bios. I am using the keyboard for input(immediate, foreground and exclusive modes) in full screen set up by D3DX util lib functions. The problem is still there. For an experiment I tried lenghtening my code by another 30ms by redrawing it 3 times (each redraw is 15ms) for a total of 45ms. I used Sleep(15) between begin and end scene. This time the 15ms didn't help, instead I had to change it to 45ms. So it would seem that I have to increment the time delay by the same amount as time it takes to render the scene. So if rendering takes 500ms the time delay will be 500ms also. You can imagine the fps I will be getting then in fullscreen, and if this is so then I don't have a choice and will run my game windowed instead of fullscreen. Curiously I can delete Sleep(45) and recompile, then run in windowed mode(still using immediate, exclusive, foreground modes) with no problems, except this time rendering is slower since I am redrawing same objects 3 times. Am I the only one who has this problem? Do you think it's my video card or its drivers? Anyone? Thank you and take care.