Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Pages: 1 [2]

Author Topic: Issues with OIS Mouse (bug?), Found the bug!  (Read 4991 times)

lathe

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 1
    • View Profile
Re: Issues with OIS Mouse (bug?), Found the bug!
« Reply #15 on: October 20, 2009, 04:34:45 PM »

This fixed an issue I was having at any framerate below 500.  Nice fix, spent a lil too much time hacking my own solution together instead of searching harder
Logged

Svenstaro

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 2
    • View Profile
Re: Issues with OIS Mouse (bug?), Found the bug!
« Reply #16 on: November 13, 2009, 05:18:24 PM »

Has this patch ever been merged?
https://sourceforge.net/tracker/index.php?func=detail&aid=1981254&group_id=149835&atid=775955 still shows open. It's been almost two years. What's up? Is OIS not actively developed or maintained anymore?
Logged

Entelin

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Re: Issues with OIS Mouse (bug?), Found the bug!
« Reply #17 on: April 21, 2010, 01:08:03 AM »

The change has not been merged, and the bug still exists in the svn version. The distance the mouse travels on the screen given a physical motion should not change, regardless of fps. The current code in LinuxMouse::_processXEvents() iterates over the entire mouse event stack, however the stack only holds the most current relative motion event and not the sum of everything thats happened, so the lower the fps, the less actual motion is captured.

The fix is to move everything within   if( event.type == MotionNotify ) {....}  out of the while loop and use  if ( XQueryPointer(display, window, &u1, &current_win, &u2, &u2, &x, &y, &mmask) )  to query the mouses state every frame instead, this is what SDL does in their code for example. The patch submitted to the bugtracker earlier in this thread shows what I did exactly.

Its a fairly serious bug... hopefully it will be merged at some point.
Logged

Entelin

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 13
    • View Profile
Re: Issues with OIS Mouse (bug?), Found the bug!
« Reply #18 on: April 29, 2010, 01:44:08 PM »

I think my previous patch resulted in mMoved being true all the time,  mMoved = true  needs to be relocated here:

Code: [Select]
//Compute this frames Relative X & Y motion
mState.X.rel = x - oldXMouseX;
mState.Y.rel = y - oldXMouseY;
if (x != oldXMouseX || y != oldXMouseY) mMoved = true;
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: Issues with OIS Mouse (bug?), Found the bug!
« Reply #19 on: May 02, 2010, 06:21:14 PM »

If there is a correction to the patch, please update the patch tracker. I hopefully will get to clearing out all patches soon.
Logged
Pages: 1 [2]