Original Post
Hi,
I'm writing a small project in C#, using SlimDX and DirectX9, and I've worked on input for some time now. My problem is, I can't seem to get it absolutely lag free.
What I've got is a small test project, which only goal is to render a quad on the screen where the windows cursor is. This all works fine, except the quad moves a few ms behind the cursor, so if I just keep moving the cursor to the right for example, the quad is located a few mm to the left of the cursor. The program runs in windowed mode at > 200 fps.
* Overriding the controls OnMouseMove, using the event, listening to WM_MOUSEMOVE in WndProc etc etc, nothing based on WM_MOUSEMOVE seems to cut it
* Using RawInput, i.e. registering RegisterRawInputDevices and use WM_INPUT, but it gives the exact same result (I tried drawing one two quads simultaneously just to see, and they move exactly the same provided I turn off mouse acceleration)
* DirectInput is deprecated, and the docs says: "Internally, DirectInput creates a second thread to read WM_INPUT data, and using the DirectInput APIs will add more overhead than simply reading WM_INPUT directly."
What else is there?
Is it possible that it's not the input that's lagging but something with the drawing of directx stuff to the window?
I'm writing a small project in C#, using SlimDX and DirectX9, and I've worked on input for some time now. My problem is, I can't seem to get it absolutely lag free.
What I've got is a small test project, which only goal is to render a quad on the screen where the windows cursor is. This all works fine, except the quad moves a few ms behind the cursor, so if I just keep moving the cursor to the right for example, the quad is located a few mm to the left of the cursor. The program runs in windowed mode at > 200 fps.
* Overriding the controls OnMouseMove, using the event, listening to WM_MOUSEMOVE in WndProc etc etc, nothing based on WM_MOUSEMOVE seems to cut it
* Using RawInput, i.e. registering RegisterRawInputDevices and use WM_INPUT, but it gives the exact same result (I tried drawing one two quads simultaneously just to see, and they move exactly the same provided I turn off mouse acceleration)
* DirectInput is deprecated, and the docs says: "Internally, DirectInput creates a second thread to read WM_INPUT data, and using the DirectInput APIs will add more overhead than simply reading WM_INPUT directly."
What else is there?
Is it possible that it's not the input that's lagging but something with the drawing of directx stuff to the window?