Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


DirectX Input Question -> Mouse Filtering.

This topic is 5550 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m making a game engine and i have a question about the DirectX Mouse Input.Is there a way to make linear filtering of the mouse? I ask that because the mouse movement is little ugly. I found in the Fluid Studio''s site a demo with DirectX linear filtering.Can anyone tell me how to do that? Please answer. Thanks in advance.

Share this post

Link to post
Share on other sites
You could always just store the values read and then just mean them out. That is one way of smoothing the mouse.

i.e. (this is from my head so may have compile errors but gives general idea)

#define SMOOTH_MAX 10

class Mouse ..
LONG m_Current;

LONG Read()
m_Read[m_Current] = m_Mouse.LX (for example) // Mouse Read Value

LONG lCount = 0; // Add Up All Values Read & Mean
for (INT i=0; i< SMOOTH_MAX; i++){
lCount += m_Read;
lCount /= SMOOTH_MAX;

if (m_Current ++ >= SMOOTH_MAX) // Increment Counter
m_Current = 0;

return lCount;


Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!