ウィンドウのサイズを変更するときに NSOpenGLView を正しくサイズ変更しようとしましたが、説明できない奇妙な動作が続いています。次のようになります。
オリジナル(最初はどのように見えるか):
リサイズ後:
これは私のサイズ変更コードです:
- (void)reshape
{
[super reshape];
CGLLockContext([[self openGLContext] CGLContextObj]);
NSRect viewRectPoints = [self bounds];
#if SUPPORT_RETINA_RESOLUTION
NSRect viewRectPixels = [self convertRectToBacking:viewRectPoints];
#else //if !SUPPORT_RETINA_RESOLUTION
NSRect viewRectPixels = viewRectPoints;
#endif // !SUPPORT_RETINA_RESOLUTION
[self resizeWithWidth:viewRectPixels.size.width
AndHeight:viewRectPixels.size.height];
CGLUnlockContext([[self openGLContext] CGLContextObj]);
}
- (void) resizeWithWidth:(GLuint)width AndHeight:(GLuint)height
{
glViewport(0, 0, width, height);
m_width = width;
m_height = height;
}
私が使用しているのは、「glViewport(0, 0, m_width, m_height);」です。glDrawArrays() を呼び出すたびに;
誰でも助けることができますか?