The X Toolkit API

X.shaders

/**
* Create a pair of shaders which consists of a vertex and a fragment shader.
*
* @constructor
* @extends X.base
*/
var s = new X.shaders();
/**
* The className of this class.
*
* @type {string}
* @protected
*/
s._classname = $_CLASSNAME;
/**
* The 'dirty' flag of this object.
*
* @type {boolean}
* @protected
*/
s._dirty = $_DIRTY;
/**
* The fragment shader source of this shader pair. By default, a basic shader
* supporting fragment colors is defined.
*
* @type {!string}
* @protected
*/
s._fragmentshaderSource = $_FRAGMENTSHADERSOURCE;
/**
* The uniqueId of this instance. Each class instance in XTK has a uniqueId.
*
* @type {number}
* @protected
*/
s._id = $_ID;
/**
* The vertex shader source of this shader pair. By default, a basic shader
* supporting vertex positions and vertex colors is defined.
*
* @type {!string}
* @protected
*/
s._vertexshaderSource = $_VERTEXSHADERSOURCE;
/**
* Get the className of this object.
*
* @return {string} The className of this object.
* @public
*/
var _classname = s.classname;
/**
* Get the id of this instance.
*
* @return {string} The className of this object.
* @public
*/
var _id = s.id;
/**
* Get the fragment shader source of this shader pair.
*
* @return {!string} The fragment shader source.
*/
var fragment = s.fragment();
/**
* Checks if this configured shaders object is valid in terms of using the
* defined attributes and uniforms.
*
* @return {boolean} TRUE or FALSE depending on success.
* @throws {Error} An exception if the shader is invalid.
*/
var validate = s.validate();
/**
* Get the vertex shader source of this shader pair.
*
* @return {!string} The vertex shader source.
*/
var vertex = s.vertex();
/**
* The X.shaders' vertex attributes.
*
* @enum {string}
* @protected
*/
X.shaders.attributes();
/**
* The X.shaders' uniforms.
*
* @enum {string}
* @protected
*/
X.shaders.uniforms();


CONSTRUCTORS
X.shaders

PROPERTIES
_classname
_dirty
_fragmentshaderSource
_id
_vertexshaderSource

GETTERS/SETTERS
classname
id

FUNCTIONS
fragment
validate
vertex

STATIC
attributes
uniforms



SOURCECODE