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 4 of 4

Thread: GLFW cursor handling

  1. #1
    Intern Contributor
    Join Date
    Nov 2002
    Location
    Torun/Poland
    Posts
    60

    GLFW cursor handling

    Hi,
    I'm using GLFW and want to create own cursor bitmap, so i disable showing cursor. I position a bitmap at read mouse position, but the resoults aren't as I expect - mouse either doesn't move or moves totally strange.
    Any tips????

  2. #2
    Advanced Member Frequent Contributor marcus256's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    853

    Re: GLFW cursor handling

    Hi!

    That's because when you disable the mouse cursor, the mouse position is not window bound anymore. You can think of the mouse position as the physical position reported by the mouse (e.g. x,y = -680234,5555342 is a fully valid mouse position when the mouse cursor is disabled).

    It may also be a result of a known bug in the X11 version of GLFW, which causes the mouse sensitivity to be degraded when the mouse cursor is disabled. (the bug is fixable)

  3. #3
    Intern Contributor
    Join Date
    Nov 2002
    Location
    Torun/Poland
    Posts
    60

    Re: GLFW cursor handling

    I think that it's mostly the second thing you mentioned - and it depends
    on the compilation of X11 / GLFW.
    I knew that mouse pos would be reported as an integer from all the range,
    so as soon as I open window I read mouse position and treat it as a reference.
    How is this bug fixable and will it be fixed in forthcoming versions?

    Thanks for reply.

  4. #4
    Advanced Member Frequent Contributor marcus256's Avatar
    Join Date
    Aug 2001
    Location
    Sweden
    Posts
    853

    Re: GLFW cursor handling

    I reccon the bug is due to GLFWs way of constantly centering the (hidden) mouse cursor (in order to avoid running into the window edges). I think that the X server keeps track of sub-pixel information about the cursor position, which gets erased once the cursor position is forced to the center of the window.

    The solution would be to center the cursor more seldom, for instance when the cursor has left some "threshold box" (e.g. half the way to the window edge). That would minimize the cursor position error.

Posting Permissions

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