Browse Source

Retrieves sizes of client area from window rather than hard coded value

David Wimsey 11 years ago
parent
commit
998fb609d9

+ 3 - 1
Samples/shell/src/macosx/ShellRenderInterfaceExtensionsOpenGL_MacOSX.cpp

@@ -99,7 +99,9 @@ bool ShellRenderInterfaceOpenGL::AttachToNative(void *nativeWindow)
 	
 	glMatrixMode(GL_PROJECTION);
 	glLoadIdentity();
-	glOrtho(0, 1024, 768, 0, -1, 1);
+	Rect crect;
+	GetWindowBounds(window, kWindowContentRgn, &crect);
+	glOrtho(0, (crect.right - crect.left), (crect.bottom - crect.top), 0, -1, 1);
 	
 	glMatrixMode(GL_MODELVIEW);
 	glLoadIdentity();