PDA

View Full Version : resizing subwindow



wmelgaard
05-14-2014, 07:32 AM
I have an existing subwindow that is to be replaced by a different one.
Should I destroy the original and then create a new one, or merely change the size of the existing one?
How do I change the size of a subwindow? glViewport(...) does not seem to affect the existing window.

Lighttec
05-14-2014, 09:41 AM
What windowing system do you use?
The function glViewport(...) is used for the transformation of normalized device coordinates to window coordinates (see MSGN for further info).

wmelgaard
05-14-2014, 03:44 PM
The window was created with
subWindow = glutCreateSubWindow(mainWindow, margin, margin, width, height);
glViewport(0, 0, (GLsizei) width, (GLsizei) height);

Basically, I want to change width & height.


What windowing system do you use?
The function glViewport(...) is used for the transformation of normalized device coordinates to window coordinates (see MSGN for further info).

dorbie
05-14-2014, 11:19 PM
This is a GLUT question not an OpenGL question.

After you have created a subwindow you can use glutSetWindow and glutPositionWindow and glutReshapeWindow on the subwindow to adjust what you need.