Browse Source

Set the orhographic projection near and far planes to larger values such that transforms are not clipped when the perspective is not set.

Michael Ragazzon 6 years ago
parent
commit
f81e52f901

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

@@ -47,7 +47,7 @@ void ShellRenderInterfaceOpenGL::SetViewport(int width, int height)
 		m_height = height;
 		m_height = height;
 
 
 		glViewport(0, 0, width, height);
 		glViewport(0, 0, width, height);
-		projection = Rml::Core::Matrix4f::ProjectOrtho(0, width, height, 0, -1, 1);
+		projection = Rml::Core::Matrix4f::ProjectOrtho(0, (float)width, (float)height, 0, -10000, 10000);
 		glMatrixMode(GL_PROJECTION);
 		glMatrixMode(GL_PROJECTION);
 		glLoadMatrixf(projection);
 		glLoadMatrixf(projection);
 		view = Rml::Core::Matrix4f::Identity();
 		view = Rml::Core::Matrix4f::Identity();

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

@@ -47,7 +47,7 @@ void ShellRenderInterfaceOpenGL::SetViewport(int width, int height)
 		m_height = height;
 		m_height = height;
 		
 		
 		glViewport(0, 0, width, height);
 		glViewport(0, 0, width, height);
-		projection = Rml::Core::Matrix4f::ProjectOrtho(0, (float)width, (float)height, 0, -1, 1);
+		projection = Rml::Core::Matrix4f::ProjectOrtho(0, (float)width, (float)height, 0, -10000, 10000);
 		glMatrixMode(GL_PROJECTION);
 		glMatrixMode(GL_PROJECTION);
 		glLoadMatrixf(projection.data());
 		glLoadMatrixf(projection.data());
 		view = Rml::Core::Matrix4f::Identity();
 		view = Rml::Core::Matrix4f::Identity();

+ 1 - 1
Samples/shell/src/x11/ShellRenderInterfaceExtensionsOpenGL_X11.cpp

@@ -49,7 +49,7 @@ void ShellRenderInterfaceOpenGL::SetViewport(int width, int height)
 		m_height = height;
 		m_height = height;
 		
 		
 		glViewport(0, 0, width, height);
 		glViewport(0, 0, width, height);
-		projection = Rml::Core::Matrix4f::ProjectOrtho(0, width, height, 0, -1, 1);
+		projection = Rml::Core::Matrix4f::ProjectOrtho(0, (float)width, (float)height, 0, -10000, 10000);
 		glMatrixMode(GL_PROJECTION);
 		glMatrixMode(GL_PROJECTION);
 		glLoadMatrixf(projection.data());
 		glLoadMatrixf(projection.data());
 		view = Rml::Core::Matrix4f::Identity();
 		view = Rml::Core::Matrix4f::Identity();