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: hiding mouse

  1. #1
    Junior Member Newbie
    Join Date
    May 2002
    Location
    France
    Posts
    22

    hiding mouse

    hi,

    i just need to hide the hotspot og the mouse when i move it for a camera moving!!!

    how to do that!!!

    i work under X windows system, on linux not Windows!!!

    is that a link with GLX?

  2. #2
    Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Greece
    Posts
    496

    Re: hiding mouse

    If you're using some widget library like gtk you're on your own,although it should be pretty easy.
    If you're using Xlib calls though I recently came across this problem myself.I didn't find a XHidePointer function or something simlar but you can bind a specific pointer graphic to every window.So when you need to hide your window just bind a pointer that is totally trnasparent.I know that X offers a set of pointers,there should be a transparent one there.Have a look at the Xlib manuals and post if you find anything.I'll have a look as well if I find the time(damned semester finals)

  3. #3
    Advanced Member Frequent Contributor
    Join Date
    Oct 2000
    Posts
    531

    Re: hiding mouse

    X offers indeed a set of mouse pointers, but the pointer which should be transparent isn't really transparent (defaults to the normal left arrow)

    AFAIK this is the only way to to hide the cursor:

    Code :
    Cursor  cur;
    Pixmap  bp;     // short name for [B]b[/B]lank [B]p[/B]ixmap
    XColor  dummy;
    char    data[1] = { 0 };
     
    bp = XCreateBitmapFromData(GLWin.dpy, GLWin.win, data, 1, 1);
    if (bp == None) printf("Aaaaargh! Somebody help! I'm out of memory!");
    cur = XCreatePixmapCursor(GLWin.dpy, bp, bp, &dummy, &dummy, 0, 0);
    XFreePixmap(GLWin.dpy, bp);
    XDefineCursor(GLWin.dpy, GLWin.win, cur);

    [edit]
    Hm, I'm not sure since I'm currently working with XP (very, very temporary) so I can't try it, but I think the cur variable should be deallocated @ program exit.
    [/edit]


    [This message has been edited by richardve (edited 05-30-2002).]

  4. #4
    Member Regular Contributor
    Join Date
    Apr 2001
    Location
    Greece
    Posts
    496

    Re: hiding mouse

    An other alternative(especially if you have loaded some font for an other purpose) is to use XCreateGlyphCursor() and specify the source glyph as the space character.That should do the trick as well.

Posting Permissions

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