把图像尽量拉满:
void ext(int & w, int &h, int winW, int WinH) { double wRatio = winW * 1.0f / w; double hRatio = WinH * 1.0f / h; if (wRatio < hRatio) { w = winW; h = (int) (wRatio * h); } else { h= WinH; w = (int) (hRatio * w); } }
标签:窗口,OpenGL,int,wRatio,winW,WinH,宽高比,hRatio From: https://www.cnblogs.com/8335IT/p/16944642.html