|
@@ -41,6 +41,9 @@ THREE.WebGLState = function ( gl, extensions, paramThreeToGL ) {
|
|
|
var currentTextureSlot = undefined;
|
|
|
var currentBoundTextures = {};
|
|
|
|
|
|
+ var currentScissor = new THREE.Rectangle();
|
|
|
+ var currentViewport = new THREE.Rectangle();
|
|
|
+
|
|
|
this.init = function () {
|
|
|
|
|
|
gl.clearColor( 0, 0, 0, 1 );
|
|
@@ -509,6 +512,30 @@ THREE.WebGLState = function ( gl, extensions, paramThreeToGL ) {
|
|
|
|
|
|
//
|
|
|
|
|
|
+ this.scissor = function ( scissor ) {
|
|
|
+
|
|
|
+ if ( currentScissor.equals( scissor ) === false ) {
|
|
|
+
|
|
|
+ gl.scissor( scissor.x, scissor.y, scissor.width, scissor.height );
|
|
|
+ currentScissor.copy( scissor );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ this.viewport = function ( viewport ) {
|
|
|
+
|
|
|
+ if ( currentViewport.equals( viewport ) === false ) {
|
|
|
+
|
|
|
+ gl.viewport( viewport.x, viewport.y, viewport.width, viewport.height );
|
|
|
+ currentViewport.copy( viewport );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ };
|
|
|
+
|
|
|
+ //
|
|
|
+
|
|
|
this.reset = function () {
|
|
|
|
|
|
for ( var i = 0; i < enabledAttributes.length; i ++ ) {
|