I’m drawing a simple pentagon on the screen and it has a callback reshape function, but when the window is reshaped (resized) nothing changes. When this same reshape function is placed in the program where I originally got it from, it resizes the drawing in relation to the window.
This is the reshape function:
void reshape (int w, int h)
{
glViewport (0, 0, (GLsizei) w, (GLsizei) h);
glMatrixMode (GL_PROJECTION);
glLoadIdentity ();
gluOrtho2D(Vx_min, Vx_max, Vy_min, Vy_max);
glMatrixMode (GL_MODELVIEW);
}
It’s called using:
glutReshapeFunc(reshape);
Again this works with one program, but not the other. Any ideas?