OpenGL(GLUT)调整窗口大小时重绘

void reshape(int w, int h)
{
    glViewport(0, 0, w, h);
    myDisplay();
}

...

    glutDisplayFunc(myDisplay);
    glutReshapeFunc(reshape);
原文地址:https://www.cnblogs.com/ageane/p/reshape.html