Explorar o código

Merge pull request #11374 from WestLangley/dev-dpr

WebGLRenderer: added getPhysicalSize()
Mr.doob %!s(int64=8) %!d(string=hai) anos
pai
achega
f373dbdef7
Modificáronse 2 ficheiros con 12 adicións e 0 borrados
  1. 3 0
      docs/api/renderers/WebGLRenderer.html
  2. 9 0
      src/renderers/WebGLRenderer.js

+ 3 - 0
docs/api/renderers/WebGLRenderer.html

@@ -353,6 +353,9 @@
 		<h3>[method:Number getMaxAnisotropy]()</h3>
 		<div>This returns the anisotropy level of the textures.</div>
 
+		<h3>[method:Object getDrawingBufferSize]()</h3>
+		<div>Returns an object containing the width and height of the renderer's drawing buffer, in pixels.</div>
+
 		<h3>[method:number getPixelRatio]()</h3>
 		<div>Returns current device pixel ratio used.</div>
 

+ 9 - 0
src/renderers/WebGLRenderer.js

@@ -406,6 +406,15 @@ function WebGLRenderer( parameters ) {
 
 	};
 
+	this.getDrawingBufferSize = function () {
+
+		return {
+			width: _width * _pixelRatio,
+			height: _height * _pixelRatio
+		};
+
+	};
+
 	this.setSize = function ( width, height, updateStyle ) {
 
 		var device = vr.getDevice();