[OpenGL] 윈도우 사이즈 변경에 따른 왜곡 방지
void MyReshape(int NewWidth, int NewHeight){ glViewport(0,0,NewWidth, NewHeight); GLfloat WidthFactor = (GLfloat)NewWidth / (GLfloat)400; GLfloat HeightFactor = (GLfloat)NewHeight / (GLfloat)400; glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(-1.0*WidthFactor, 1.0*WidthFactor, -1.0*HeightFactor, 1.0*HeightFactor, -1.0, 1.0); } int main(int argc, char** argv){ glutInit(&argc, argv); glutI..
더보기