OK, here's the plan, obviously you only need to implement the anti-mouse lag fixes discussed recently if you use DirectX (not OpenGL) AND there is an actual lag!
Why not implement them all the time? Well it's seems there is a performance hit on some systems, even for the most recent best fix.
How can you tell if there is a lag? Well you can't ask the user but you might be able to test it! This BlitzPlus function I wrote returns the mouse cursor in Windows:
It used this line in user32.decls (which you can do now with extern right?)
If you compare the value of the windows cursor position over a few frames when it is moving against the BlitzMax returned mouse cursor position, will it be different I wonder? I haven't tested this yet... If it's different you know you have lag and how bad it is and can automatically turn on the mosuelag fix, cool! Or of course just use the returned values from that function as your cursor position (but I'm sure some of you would have though of this already hmm ...)
Of course this entire plan falls down if GetCursorPos returns the same position as the BlitzMax cursor pos in full-screen mode (the lag only affects full-screen mode anyway right? or is that wrong? Actually some of the tests might have been in windowed mode come to think of it) Or if I've misunderstood and it's not a problem reading the mouse coords it's just a delay in the DirectX rendering pipeline so what you see is several frames behind all input, including keyboard input, but that's not right is it? Sorry if I'm sounding dumb here but a) it's late and b) I never 100% understood the original problem but had a brainwave that this could be a solution ...
comments?
Why not implement them all the time? Well it's seems there is a performance hit on some systems, even for the most recent best fix.
How can you tell if there is a lag? Well you can't ask the user but you might be able to test it! This BlitzPlus function I wrote returns the mouse cursor in Windows:
Type RectType Field RLeft%, RTop%, RRight%, RBottom% End Type Function ccGetCursorPos.PointType() ;Returns a PointType that the user must free when they are finished with it pt.PointType = New PointType If Not User32_GetCursorPos(pt) Then ccRunTimeError ("Error Getting Cursor Pos") Return Null Else Return pt EndIf End Function
It used this line in user32.decls (which you can do now with extern right?)
User32_GetCursorPos%(lpPoint*):"GetCursorPos"
If you compare the value of the windows cursor position over a few frames when it is moving against the BlitzMax returned mouse cursor position, will it be different I wonder? I haven't tested this yet... If it's different you know you have lag and how bad it is and can automatically turn on the mosuelag fix, cool! Or of course just use the returned values from that function as your cursor position (but I'm sure some of you would have though of this already hmm ...)
Of course this entire plan falls down if GetCursorPos returns the same position as the BlitzMax cursor pos in full-screen mode (the lag only affects full-screen mode anyway right? or is that wrong? Actually some of the tests might have been in windowed mode come to think of it) Or if I've misunderstood and it's not a problem reading the mouse coords it's just a delay in the DirectX rendering pipeline so what you see is several frames behind all input, including keyboard input, but that's not right is it? Sorry if I'm sounding dumb here but a) it's late and b) I never 100% understood the original problem but had a brainwave that this could be a solution ...
comments?