Bläddra i källkod

Fixed initial call to glOrtho to use the window size rather than hardcoded value

David Wimsey 11 år sedan
förälder
incheckning
7890511914

+ 3 - 1
Samples/shell/src/win32/ShellRenderInterfaceExtensionsOpenGL_Win32.cpp

@@ -118,7 +118,9 @@ bool ShellRenderInterfaceOpenGL::AttachToNative(void *nativeWindow)
 
 
 	glMatrixMode(GL_PROJECTION);
 	glMatrixMode(GL_PROJECTION);
 	glLoadIdentity();
 	glLoadIdentity();
-	glOrtho(0, 1024, 768, 0, -1, 1);
+	RECT crect;
+	GetClientRect(this->window_handle, &crect)
+	glOrtho(0, (crect.right - crect.left), (crect.bottom - crect.top), 0, -1, 1);
 
 
 	glMatrixMode(GL_MODELVIEW);
 	glMatrixMode(GL_MODELVIEW);
 	glLoadIdentity();
 	glLoadIdentity();