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: viewport problem

  1. #1
    Intern Contributor
    Join Date
    Jul 2001
    Location
    Tokyo
    Posts
    54

    viewport problem

    Hi,

    I have a opengl window with different views of the same scene. To achieve this I use glViewport. Everything works fine except for 2 things:

    1. When I use bitmap characters with glutBitmapCharacter, the characters cross the border set with glViewport and are also displayed outside of it. How can I avoid this?

    2. Picking and reading the depth buffer don't seem to be influenced by the viewport and are always relative to the whole window. Also I found a workaround, this seems strange to me.

    Can someone explain me these points??

    Thanks

  2. #2
    Intern Contributor
    Join Date
    Jul 2001
    Location
    Tokyo
    Posts
    54

    Re: viewport problem

    Sorry, me again...

    I have another similar question:
    the command glClear(...) is also always relative to the whole window and not the viewport. How can I change this?

    Concret example: I have a first viewport which has the same size as my window. I render the scene to that viewport. After that I want to display the same scene with a different view angle in a smaller viewport above the first one (kind of window in window). To achieve this I have to clear the color and depth buffer of the zone specified by my second viewport. But the command glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) clears my whole window...

  3. #3
    Member Regular Contributor
    Join Date
    Aug 2001
    Location
    England
    Posts
    291

    Re: viewport problem

    Look at glScissor - I think this is what you are after

    While the scissor test is enabled, only pixels that lie within the scissor box can be modified by drawing commands.

  4. #4
    Intern Contributor
    Join Date
    Jul 2001
    Location
    Tokyo
    Posts
    54

    Re: viewport problem

    Thanks Shag!

    glScissor works fine with glutBitmapCharacter... but it seems that it doesn't affect glClear at all?? Do I have to clear pixel after pixel?

  5. #5
    Intern Contributor
    Join Date
    Jul 2001
    Location
    Tokyo
    Posts
    54

    Re: viewport problem

    Sorry sorry,

    I did a stupid mistake, but now it is working! So glScissor affects glClear...

    Thanks

Posting Permissions

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