瀏覽代碼

no need for application to worry about devicePixelRatio any more

Juergen Ahting 11 年之前
父節點
當前提交
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 );