clear color
parent
e2faf5be25
commit
f6f1c8a628
|
@ -7,6 +7,7 @@
|
|||
* @param width
|
||||
* @param height
|
||||
* @param domElement
|
||||
* @param clearColor
|
||||
* @param parentEntity
|
||||
* @param preserveDrawingBuffer
|
||||
* @constructor
|
||||
|
@ -20,6 +21,7 @@ GameLib.D3.API.Renderer = function (
|
|||
height,
|
||||
preserveDrawingBuffer,
|
||||
domElement,
|
||||
clearColor,
|
||||
parentEntity
|
||||
) {
|
||||
|
||||
|
@ -72,6 +74,11 @@ GameLib.D3.API.Renderer = function (
|
|||
domElement = null;
|
||||
}
|
||||
this.domElement = domElement;
|
||||
|
||||
if (GameLib.Utils.UndefinedOrNull(clearColor)) {
|
||||
clearColor = new GameLib.API.Color();
|
||||
}
|
||||
this.clearColor = clearColor;
|
||||
};
|
||||
|
||||
GameLib.D3.API.Renderer.prototype = Object.create(GameLib.Component.prototype);
|
||||
|
@ -92,6 +99,7 @@ GameLib.D3.API.Renderer.FromObjectComponent = function(objectComponent) {
|
|||
objectComponent.height,
|
||||
objectComponent.preserveDrawingBuffer,
|
||||
objectComponent.domElement,
|
||||
objectComponent.clearColor,
|
||||
objectComponent.parentEntity
|
||||
);
|
||||
};
|
||||
|
|
|
@ -30,9 +30,16 @@ GameLib.D3.Renderer = function (
|
|||
apiRenderer.height,
|
||||
apiRenderer.preserveDrawingBuffer,
|
||||
apiRenderer.domElement,
|
||||
apiRenderer.clearColor,
|
||||
apiRenderer.parentEntity
|
||||
);
|
||||
|
||||
this.clearColor = new GameLib.Color(
|
||||
this.graphics,
|
||||
this.clearColor,
|
||||
this
|
||||
);
|
||||
|
||||
if (this.domElement instanceof GameLib.API.DomElement) {
|
||||
this.domElement = new GameLib.DomElement(
|
||||
this.domElement
|
||||
|
@ -69,6 +76,15 @@ GameLib.D3.Renderer.prototype.createInstance = function(update) {
|
|||
this.height
|
||||
);
|
||||
|
||||
instance.setClearColor(
|
||||
new THREE.Color(
|
||||
this.clearColor.r,
|
||||
this.clearColor.g,
|
||||
this.clearColor.b
|
||||
),
|
||||
1 - this.clearColor.a
|
||||
);
|
||||
|
||||
instance.domElement.width = this.width;
|
||||
instance.domElement.height = this.height;
|
||||
|
||||
|
|
Loading…
Reference in New Issue