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

Thread: Mouse cursor?

  1. #1
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    102

    Mouse cursor?

    How can I do mouse support in my game? Should I use the original´windows pointer or is there any OGL pointer?
    CyBBe

  2. #2
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Mouse cursor?

    OpenGL has nothing to do with mouse input. You will either have to use the Windows mouse and mouse pointer functions, or use DirectX's DirectInput. DirectInput is fairly easy to learn to use and it makes handling multiple input devices very easy to do. I would suggest you hide the windows mouse cursor, and just draw your own when you need one since some older 3D video cards can not display the windows mouse cursor.

    [This message has been edited by DFrey (edited 06-07-2000).]

  3. #3
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Brisbane,QLD, Australia
    Posts
    107

    Re: Mouse cursor?

    Interesting topic here, Im not to sure but i think you can use your windows mouse cursor on any card except for the Voodoo range of cards. On these cards you need to make your own cursor. Can someone confirm this?

    For all other cards make sure when you are creating your window you have
    wndclass.hCursor = LoadCursor (NULL, IDC_CROSS);
    and then somewhere in your init
    ShowCursor(TRUE);

    // to set your cursor to center screen
    SetCursorPos(nScreenWidth/2, nScreenHeight/2); // set mouse to screen centre

    Hope this helps

  4. #4
    Junior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    102

    Re: Mouse cursor?

    hmmm, directInput sounds nice, do U know any good tutorials???
    CyBBe

  5. #5
    Senior Member OpenGL Pro
    Join Date
    Jun 2000
    Location
    Shreveport, LA, USA
    Posts
    1,757

    Re: Mouse cursor?

    You might want to look at http://www.loonygames.com/content/1.5/cotc/
    , this is the article from which I learned about DirectInput.

Posting Permissions

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