Results 1 to 2 of 2

Thread: glProject and glUnProject only accurate fullscreen

  1. #1
    Member Newbie
    Join Date
    Nov 2011
    Location
    Fairborn, OH
    Posts
    31

    glProject and glUnProject only accurate fullscreen

    I'm having a problem with glProject and glUnproject.

    If I'm running my GL instance in a window, not full screen, the point that I draw representing the UnProjected mouse cursor position is offset...it appears to be offset by however much the window is moved from initial instantiation. For example, if I move the window down, the difference increases vertically. Same for if I resize the window.

    On initialization, the offset appears to push the drawn vertex down about the same distance as the titlebar is tall, and right about the same distance as the left window border. Odd.

    Is there any way to detect this and counter it?

  2. #2
    Newbie OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,789

    Re: glProject and glUnProject only accurate fullscreen

    Your second problem suggests that you're sizing your window incorrectly on creation. For example, on Windows you should be calling AdjustWindowRect(Ex) to get the client rect size for a given backbuffer size, then feeding the result of that into your CreateWindow(Ex) call.

Similar Threads

  1. About glUnProject!
    By imported_davie in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 04-17-2010, 08:12 AM
  2. which z-values for glUnProject()?
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 10-15-2003, 12:59 AM
  3. glUnProject??
    By mishuk in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 07-16-2002, 08:13 AM
  4. glUnProject Problems
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 06-29-2001, 06:40 PM
  5. glUnProject...?
    By CyBBe in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 04-29-2000, 09:30 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