rendering to multiple windows

I want to create a solar sistem in full screen, and when the user selects a planet i want that in a small window to show only that planet spining and maybe some info text about it. How can i do that?

glViewport allows you to select what area of a window to render to, so you can render your solar system first, then change the viewport to a smaller rectangle in one of the corners or something like that and render the “zoom in” there. (remember to reset the viewport at the end…)


ok…i tryed the glViewport but the problem is that is actualy rendering the whole scene in a part of the window…and i just want to render a part…so it doesn’t work

Not sure I understand what the problem is, you can render anything you want to the current viewport, change the viewport and render something different any number of times if you want.


Yes, the thing is that i still want the solar sistem to be visible on the full screen(even if it doesn#t move anymore).
When i use glViewport the whole screeen becomes black besides the part where i render…Can’t i keep the big solar sistem, and render something differend the same time in a small window?

Did you also setup a scissor test for your new viewport? You can use that to keep glClear from clearing the rest of the scene.