Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Stutter in mouse response

  1. #1
    Newbie Newbie
    Join Date
    Jul 2012
    Posts
    2

    Stutter in mouse response

    (Apologies if I posted this in the wrong forum...)

    I have an object composed of multiple parts drawn up in my window. I am programming with Visual C++ CLI and have mouse button events written.

    I can rotate the object easily using my right mouse button - the rendering is smooth and everything looks nice.
    However, using the left mouse button results in stuttering and jumps in location (all towards desired point, but with significant delay). I can also use form elements (trackbars) to move parts around and this works well, so to me it doesn't seem like it's a rendering speed issue. I used to have simpler shapes instead of the current parts and at that point my mouse response was quite smooth.

    It feels as if the mouse motion isn't being constantly updated. My timer is set to refresh the GL scene every 10ms, and there aren't really any matrix manipulations to take up time. Has anyone had problems like this?

    Thanks!
    C

  2. #2
    Super Moderator OpenGL Guru
    Join Date
    Feb 2000
    Location
    Montreal, Canada
    Posts
    4,264
    What is Visual C++ CLI? Are you making a Windows application or not? Are you processing WM_MOUSEMOVE events?
    I don't use a timer in a "normal" windows application. I process the WM_MOUSEMOVE and call InvalidateRect(NULL, FALSE) and that causes a WM_PAINT event to be fired and it gets processed rapidly so overall, it looks like the object is moving smoothly.
    ------------------------------
    Sig: http://glhlib.sourceforge.net
    an open source GLU replacement library. Much more modern than GLU.
    float matrix[16], inverse_matrix[16];
    glhLoadIdentityf2(matrix);
    glhTranslatef2(matrix, 0.0, 0.0, 5.0);
    glhRotateAboutXf2(matrix, angleInRadians);
    glhScalef2(matrix, 1.0, 1.0, -1.0);
    glhQuickInvertMatrixf2(matrix, inverse_matrix);
    glUniformMatrix4fv(uniformLocation1, 1, FALSE, matrix);
    glUniformMatrix4fv(uniformLocation2, 1, FALSE, inverse_matrix);

  3. #3
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,198
    Quote Originally Posted by V-man View Post
    What is Visual C++ CLI? Are you making a Windows application or not? Are you processing WM_MOUSEMOVE events?
    I don't use a timer in a "normal" windows application. I process the WM_MOUSEMOVE and call InvalidateRect(NULL, FALSE) and that causes a WM_PAINT event to be fired and it gets processed rapidly so overall, it looks like the object is moving smoothly.
    What used to be "Managed C++" - see http://en.wikipedia.org/wiki/C%2B%2B/CLI - no WM_ messages here.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •