r3-legacy/src/r3-d3-shader-vertex.js

60 lines
1.3 KiB
JavaScript

/**
* R3.D3.Shader.Vertex
* @param graphics R3.Runtime.Graphics
* @param apiVertexShader
* @constructor
*/
R3.D3.Shader.Vertex = function(
graphics,
apiVertexShader
) {
this.graphics = graphics;
this.graphics.isNotThreeThrow();
if (R3.Utils.UndefinedOrNull(apiVertexShader)) {
apiVertexShader = {
shaderType : R3.D3.API.Shader.SHADER_TYPE_VERTEX
};
}
R3.D3.API.Shader.Vertex.call(
this,
apiVertexShader
);
R3.D3.Shader.call(
this,
this.graphics,
apiVertexShader
);
};
R3.D3.Shader.Vertex.prototype = Object.create(R3.D3.Shader.prototype);
R3.D3.Shader.Vertex.prototype.constructor = R3.D3.Shader.Vertex;
/**
* Creates a shader instance
* @returns {*}
*/
R3.D3.Shader.Vertex.prototype.createInstance = function() {
R3.D3.Shader.prototype.createInstance.call(this);
};
/**
* Updates the instance with the current state
*/
R3.D3.Shader.Vertex.prototype.updateInstance = function(property) {
R3.D3.Shader.prototype.updateInstance.call(this, property);
};
/**
* Converts a R3.D3.Shader to a R3.D3.API.Shader
* @returns {R3.D3.API.Shader}
*/
R3.D3.Shader.Vertex.prototype.toApiObject = function() {
var apiShader = R3.D3.Shader.prototype.toApiObject.call(this);
return apiShader;
};