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:
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?
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.
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…