Documentation generator: JsDoc Toolkit 2.4.0
Template: Codeview 1.2
Generated on: 2012-11-19 0:05

Namespace SpiderGL.Type

The SpiderGL.Type namespace.

Namespace Summary
Constructor Attributes Constructor Name and Description
 
The SpiderGL.Type namespace.
Field Summary
Field Attributes Field Name and Description
<static> <constant>  
SpiderGL.Type.BIG_ENDIAN
Big-Endian flag.
<static> <constant>  
SpiderGL.Type.FLOAT32
Constant for 32-bit floating point type.
<static> <constant>  
SpiderGL.Type.INT16
Constant for 16-bit signed integer type.
<static> <constant>  
SpiderGL.Type.INT32
Constant for 32-bit signed integer type.
<static> <constant>  
SpiderGL.Type.INT8
Constant for 8-bit signed integer type.
<static> <constant>  
SpiderGL.Type.LITTLE_ENDIAN
Little-Endian flag.
<static> <constant>  
SpiderGL.Type.NO_TYPE
Constant for undefined (void) type.
<static>  
SpiderGL.Type.primitiveToGL
<static> <constant>  
SpiderGL.Type.SIZEOF_FLOAT32
Alias for Float32Array.BYTES_PER_ELEMENT.
<static> <constant>  
SpiderGL.Type.SIZEOF_INT16
Alias for Int16Array.BYTES_PER_ELEMENT.
<static> <constant>  
SpiderGL.Type.SIZEOF_INT32
Alias for Int32Array.BYTES_PER_ELEMENT.
<static> <constant>  
SpiderGL.Type.SIZEOF_INT8
Alias for Int8Array.BYTES_PER_ELEMENT.
<static> <constant>  
SpiderGL.Type.SIZEOF_UINT16
Alias for Uint16Array.BYTES_PER_ELEMENT.
<static> <constant>  
SpiderGL.Type.SIZEOF_UINT32
Alias for Uint32Array.BYTES_PER_ELEMENT.
<static> <constant>  
SpiderGL.Type.SIZEOF_UINT8
Alias for Uint8Array.BYTES_PER_ELEMENT.
<static>  
SpiderGL.Type.typeFromGL
Maps a WebGL type constant to a WebGL type constant.
<static>  
SpiderGL.Type.typeSize
Returns the size of the type expressed by the passed symbolic constant.
<static>  
SpiderGL.Type.typeToGL
Maps a SpiderGL type symbolic constant to a WebGL type constant.
<static>  
Maps a SpiderGL type symbolic constant to a TypedArray constructor.
<static> <constant>  
SpiderGL.Type.UINT16
Constant for 16-bit unsigned integer type.
<static> <constant>  
SpiderGL.Type.UINT32
Constant for 32-bit unsigned integer type.
<static> <constant>  
SpiderGL.Type.UINT8
Constant for 8-bit unsigned integer type.

Method Summary

Method Attributes Method Name and Description
<static>  
SpiderGL.Type.defineClassGetter(ctor, name, func)
<static>  
SpiderGL.Type.defineClassSetter(ctor, name, func)
<static>  
SpiderGL.Type.defineObjectGetter(obj, name, func)
<static>  
SpiderGL.Type.defineObjectSetter(obj, name, func)
<static>  
SpiderGL.Type.extend(derived, base)
Implements inheritance.
<static>  
SpiderGL.Type.instanceOf(arg, ctor)
Tests the instance.
<static>  
SpiderGL.Type.isArray(arg)
Tests whether the argument is an array.
<static>  
SpiderGL.Type.isFunction(arg)
Tests whether the argument is a function.
<static>  
SpiderGL.Type.isNumber(arg)
Tests whether the argument is a number.
<static>  
SpiderGL.Type.isString(arg)
Tests whether the argument is a string.
<static>  
SpiderGL.Type.isTypedArray(arg)
Tests whether the argument is a typed array.
<static>  
SpiderGL.Type.typeSizeFromGL(glType)
Returns the size of the type expressed by the passed WebGL type symbolic constant.

Namespace Detail

SpiderGL.Type
The SpiderGL.Type namespace.

Field Detail

<static> <constant> {bool} SpiderGL.Type.BIG_ENDIAN
Big-Endian flag. It is true if the host system is big endian, false otherwise.
See:
SpiderGL.Type.LITTLE_ENDIAN
<static> <constant> {number} SpiderGL.Type.FLOAT32
Constant for 32-bit floating point type.
<static> <constant> {number} SpiderGL.Type.INT16
Constant for 16-bit signed integer type.
<static> <constant> {number} SpiderGL.Type.INT32
Constant for 32-bit signed integer type.
<static> <constant> {number} SpiderGL.Type.INT8
Constant for 8-bit signed integer type.
<static> <constant> {bool} SpiderGL.Type.LITTLE_ENDIAN
Little-Endian flag. It is true if the host system is little endian, false otherwise.
See:
SpiderGL.Type.BIG_ENDIAN
<static> <constant> {number} SpiderGL.Type.NO_TYPE
Constant for undefined (void) type.
<static> SpiderGL.Type.primitiveToGL
<static> <constant> {number} SpiderGL.Type.SIZEOF_FLOAT32
Alias for Float32Array.BYTES_PER_ELEMENT.
<static> <constant> {number} SpiderGL.Type.SIZEOF_INT16
Alias for Int16Array.BYTES_PER_ELEMENT.
<static> <constant> {number} SpiderGL.Type.SIZEOF_INT32
Alias for Int32Array.BYTES_PER_ELEMENT.
<static> <constant> {number} SpiderGL.Type.SIZEOF_INT8
Alias for Int8Array.BYTES_PER_ELEMENT.
<static> <constant> {number} SpiderGL.Type.SIZEOF_UINT16
Alias for Uint16Array.BYTES_PER_ELEMENT.
<static> <constant> {number} SpiderGL.Type.SIZEOF_UINT32
Alias for Uint32Array.BYTES_PER_ELEMENT.
<static> <constant> {number} SpiderGL.Type.SIZEOF_UINT8
Alias for Uint8Array.BYTES_PER_ELEMENT.
<static> {number} SpiderGL.Type.typeFromGL
Maps a WebGL type constant to a WebGL type constant. For example, calling this function with WebGLRenderingContext.UNSIGNED_BYTE as argument will return SpiderGL.Type.UINT8.
<static> {number} SpiderGL.Type.typeSize
Returns the size of the type expressed by the passed symbolic constant.
<static> {number} SpiderGL.Type.typeToGL
Maps a SpiderGL type symbolic constant to a WebGL type constant. For example, calling this function with SpiderGL.Type.UINT8 as argument will return WebGLRenderingContext.UNSIGNED_BYTE.
<static> {function} SpiderGL.Type.typeToTypedArrayConstructor
Maps a SpiderGL type symbolic constant to a TypedArray constructor. For example, calling this function with SpiderGL.Type.UINT8 as argument will return Uint8Array.
<static> <constant> {number} SpiderGL.Type.UINT16
Constant for 16-bit unsigned integer type.
<static> <constant> {number} SpiderGL.Type.UINT32
Constant for 32-bit unsigned integer type.
<static> <constant> {number} SpiderGL.Type.UINT8
Constant for 8-bit unsigned integer type.

Method Detail

  • <static> SpiderGL.Type.defineClassGetter(ctor, name, func)
    Parameters:
    ctor
    name
    func
  • <static> SpiderGL.Type.defineClassSetter(ctor, name, func)
    Parameters:
    ctor
    name
    func
  • <static> SpiderGL.Type.defineObjectGetter(obj, name, func)
    Parameters:
    obj
    name
    func
  • <static> SpiderGL.Type.defineObjectSetter(obj, name, func)
    Parameters:
    obj
    name
    func
  • <static> SpiderGL.Type.extend(derived, base)
    Implements inheritance. A class derivation is established between derived and base. The derived object can be successfully tested as being a base instance and inherits base properties and methods. It is possible to override base properties and methods by redefining them. This function must be called after assigning the derived prototype object.
    function Base(x, y) {
      this.x = x;
      this.y = y;
    };
    
    Base.prototype = {
      alertX : function () { alert("Base X: " + this.x); },
      alertY : function () { alert("Base Y: " + this.y); }
    };
    
    function Derived(x, y, z) {
      Base.call(this, x, y);
      this.z = z;
    };
    
    Derived.prototype = {
      alertY : function () { alert("Derived Y: " + this.y); },
      alertZ : function () { alert("Derived Z: " + this.z); },
    };
    
    SpiderGL.Type.extend(base, derived);
    
    var b = new Base(1, 2);
    b.alertX(); // alerts "Base X: 1"
    b.alertY(); // alerts "Base Y: 2"
    
    var d = new Base(3, 4, 5);
    d.alertX(); // alerts "Base X: 3"     (base method is kept)
    d.alertY(); // alerts "Derived Y: 4"  (base method is overridden)
    d.alertZ(); // alerts "Derived Y: 5"  (new derived method is called)
    Parameters:
    {constructor} derived
    The derived class.
    {constructor} base
    The base class.
  • <static> {bool} SpiderGL.Type.instanceOf(arg, ctor)
    Tests the instance. The arg is tested to belong to a ctor function constructor.
    Parameters:
    {any} arg
    The object to check.
    {constructor} ctor
    The class (i.e. the function constructor) that is tested for creating the object.
    Returns:
    {bool} True if arg is an instance of ctor, false otherwise.
  • <static> {bool} SpiderGL.Type.isArray(arg)
    Tests whether the argument is an array.
    Parameters:
    {any} arg
    The object to check.
    Returns:
    {bool} True if arg is an array, false otherwise.
  • <static> {bool} SpiderGL.Type.isFunction(arg)
    Tests whether the argument is a function.
    Parameters:
    {any} arg
    The object to check.
    Returns:
    {bool} True if arg is a function, false otherwise.
  • <static> {bool} SpiderGL.Type.isNumber(arg)
    Tests whether the argument is a number.
    Parameters:
    {any} arg
    The object to check.
    Returns:
    {bool} True if arg is a number, false otherwise.
  • <static> {bool} SpiderGL.Type.isString(arg)
    Tests whether the argument is a string.
    Parameters:
    {any} arg
    The object to check.
    Returns:
    {bool} True if arg is a string, false otherwise.
  • <static> {bool} SpiderGL.Type.isTypedArray(arg)
    Tests whether the argument is a typed array.
    Parameters:
    {any} arg
    The object to check.
    Returns:
    {bool} True if arg is a typed array, false otherwise.
  • <static> {number} SpiderGL.Type.typeSizeFromGL(glType)
    Returns the size of the type expressed by the passed WebGL type symbolic constant.
    Parameters:
    {number} glType
    A WebGL type symbolic constants, i.e. WebGLRenderingContext.UNSIGNED_BYTE.
    Returns:
    {number} The size in bytes of the type.