Results 1 to 5 of 5

Thread: warping cursor

  1. #1
    Guest

    warping cursor

    Hi, I'm writing a first person shooter game and need to warp the mouse pointer back to a certain spot every time it is moved. I've done this using glut before but this time im going to use windows, does anyone know how to do this?

  2. #2
    Senior Member Frequent Contributor
    Join Date
    Feb 2006
    Location
    Sweden
    Posts
    744

    Re: warping cursor

    i use this

    tagPOINT lpPoint;

    GetCursorPos(&lpPoint);
    SetCursorPos(300,300);

    mousex=(int)lpPoint.x-300;
    mousey=(int)lpPoint.y-300;

  3. #3
    Guest

    Re: warping cursor

    just what i was looking for thanks!

  4. #4
    Senior Member OpenGL Pro k_szczech's Avatar
    Join Date
    Feb 2006
    Location
    Poland
    Posts
    1,107

    Re: warping cursor

    Little hint - use the SetCursorPos only if your application is in the foreground or do it in response to WM_MOUSEMOVE. It's just nice to have the ability do pause the game and switch to another application.

  5. #5
    Guest

    Re: warping cursor

    tanks for the tip, definitly worth keeping in mind

Similar Threads

  1. rendering and warping
    By dmf9000 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-28-2004, 05:45 PM
  2. real time image-warping
    By floww in forum OpenGL: Advanced Coding
    Replies: 8
    Last Post: 08-21-2003, 04:26 AM
  3. Specular 'warping' effect
    By FatalXC in forum OpenGL: Advanced Coding
    Replies: 16
    Last Post: 10-13-2002, 11:26 PM
  4. 2d Warping.
    By artur in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 03-04-2002, 05:18 PM
  5. Warping Textured Quad
    By Sebaot in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 03-17-2001, 10:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean