Просмотр исходного кода

no need for application to worry about devicePixelRatio any more

Juergen Ahting 11 лет назад
Родитель
Сommit
ee90935953
1 измененных файлов с 4 добавлено и 7 удалено
  1. 4 7
      examples/webgl_multiple_views.html

+ 4 - 7
examples/webgl_multiple_views.html

@@ -53,8 +53,6 @@
 
 			var windowWidth, windowHeight;
 
-			var dpr = window.devicePixelRatio || 1;
-
 			var views = [
 				{
 					left: 0,
@@ -285,11 +283,10 @@
 
 					view.updateCamera( camera, scene, mouseX, mouseY );
 
-					// multiply by the device pixel ratio in order to properly support high DPI displays
-					var left   = Math.floor( windowWidth  * view.left ) * dpr;
-					var bottom = Math.floor( windowHeight * view.bottom ) * dpr;
-					var width  = Math.floor( windowWidth  * view.width ) * dpr;
-					var height = Math.floor( windowHeight * view.height ) * dpr;
+					var left   = Math.floor( windowWidth  * view.left );
+					var bottom = Math.floor( windowHeight * view.bottom );
+					var width  = Math.floor( windowWidth  * view.width );
+					var height = Math.floor( windowHeight * view.height );
 					renderer.setViewport( left, bottom, width, height );
 					renderer.setScissor( left, bottom, width, height );
 					renderer.enableScissorTest ( true );