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

Thread: using WINAPI procedures with opengl

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    22

    using WINAPI procedures with opengl

    Hi,
    My glutMouseFunc() doesn't handle the mouse scrolling.
    So in order to handle it Im forced to use some alternative way apart from Glut. I've read about it in msdn but I didn't figure out where and how to get control over the received mouse event messages. Any idea?

  2. #2
    Member Regular Contributor remdul's Avatar
    Join Date
    Mar 2004
    Location
    The Netherlands
    Posts
    335

    Re: using WINAPI procedures with opengl

    Getting hold of mouse input has always been lacking in Windows. The by Microsoft recommended way to handle this is with DirectInput, but this is a terrible solution as it drags in a large number of dependencies and is outdated as well.

    However I've found SDL to be a good alternative. I haven't FreeGLUT or other more recent GLUT clones, but I suspect they also have more complete input support. The original GLUT is so old, scroll wheels didn't even exist back then.

  3. #3
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: using WINAPI procedures with opengl

    GLFW supports scroll wheel too.

  4. #4
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    22

    Re: using WINAPI procedures with opengl

    Thanx for the answares guys, but I have another question. Do I need to synchronise the threads of callbacks of those functions?

    glutMouseFunc( void (* callback)( int, int, int, int ) );
    glutMotionFunc( void (* callback)( int, int ) );
    glutDisplayFunc( void (* callback)( void ) );

  5. #5
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,655

    Re: using WINAPI procedures with opengl

    Callback are not threads. Pretty much the opposite, in fact. So no, no need to synchronize anything (unless you add your own threads, but you should not).

  6. #6
    Junior Member Newbie
    Join Date
    Sep 2009
    Posts
    22

    Re: using WINAPI procedures with opengl

    Two callbacks called from two paralel distinct treads are still treads. If they are called one after another in the same tread then there's no need for tread synchronisation. So are you sure that the synchronisation is not necessary?

Posting Permissions

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