I have got a small question while coding. I want to draw a cube, using GLUT in C++. Im using the window to viewport transformation to draw the cube in the middle of the screen.
Now the viewport window has a size, and if I move the cube in the viewport it moves fine, however it leaves or "hangs out" from the side of the viewport window.
How could I make that if some parts of a cube leave the viewport window then it would disappear?
Drawing in the rest of the window after i draw the cube in the viewport using GL_POLYGON is not a solution.
Is there a way to create separate "canvases", or something like that in GLUT?