lib/pixi/src/core/renderers/webgl/utils/Quad.js
function Quad(gl)
{
    /*
     * the current WebGL drawing context
     *
     * @member {WebGLRenderingContext}
     */
    this.gl = gl;

//    this.textures = new TextureUvs();

    /**
     * An array of vertices
     *
     * @member {Float32Array}
     */
    this.vertices = new Float32Array([
        0,0,
        200,0,
        200,200,
        0,200
    ]);

    /**
     * The Uvs of the quad
     *
     * @member {Float32Array}
     */
    this.uvs = new Float32Array([
        0,0,
        1,0,
        1,1,
        0,1
    ]);

//    var white = (0xFFFFFF >> 16) + (0xFFFFFF & 0xff00) + ((0xFFFFFF & 0xff) << 16) + (1 * 255 << 24);
    //TODO convert this to a 32 unsigned int array
    /**
     * The color components of the triangles
     *
     * @member {Float32Array}
     */
    this.colors = new Float32Array([
        1,1,1,1,
        1,1,1,1,
        1,1,1,1,
        1,1,1,1
    ]);

    /*
     * @member {Uint16Array} An array containing the indices of the vertices
     */
    this.indices = new Uint16Array([
        0, 1, 2, 0, 3, 2
    ]);

    /*
     * @member {WebGLBuffer} The vertex buffer
     */
    this.vertexBuffer = gl.createBuffer();

    /*
     * @member {WebGLBuffer} The index buffer
     */
    this.indexBuffer = gl.createBuffer();

    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    gl.bufferData(gl.ARRAY_BUFFER, (8 + 8 + 16) * 4, gl.DYNAMIC_DRAW);

    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);

    this.upload();
}
function Quad(gl)
{
    /*
     * the current WebGL drawing context
     *
     * @member {WebGLRenderingContext}
     */
    this.gl = gl;

//    this.textures = new TextureUvs();

    /**
     * An array of vertices
     *
     * @member {Float32Array}
     */
    this.vertices = new Float32Array([
        0,0,
        200,0,
        200,200,
        0,200
    ]);

    /**
     * The Uvs of the quad
     *
     * @member {Float32Array}
     */
    this.uvs = new Float32Array([
        0,0,
        1,0,
        1,1,
        0,1
    ]);

//    var white = (0xFFFFFF >> 16) + (0xFFFFFF & 0xff00) + ((0xFFFFFF & 0xff) << 16) + (1 * 255 << 24);
    //TODO convert this to a 32 unsigned int array
    /**
     * The color components of the triangles
     *
     * @member {Float32Array}
     */
    this.colors = new Float32Array([
        1,1,1,1,
        1,1,1,1,
        1,1,1,1,
        1,1,1,1
    ]);

    /*
     * @member {Uint16Array} An array containing the indices of the vertices
     */
    this.indices = new Uint16Array([
        0, 1, 2, 0, 3, 2
    ]);

    /*
     * @member {WebGLBuffer} The vertex buffer
     */
    this.vertexBuffer = gl.createBuffer();

    /*
     * @member {WebGLBuffer} The index buffer
     */
    this.indexBuffer = gl.createBuffer();

    gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);
    gl.bufferData(gl.ARRAY_BUFFER, (8 + 8 + 16) * 4, gl.DYNAMIC_DRAW);

    gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);
    gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, this.indices, gl.STATIC_DRAW);

    this.upload();
}
function Quad ( gl ) { /*
     * the current WebGL drawing context
     *
     * @member {WebGLRenderingContext}
     */ this . gl = gl ; //    this.textures = new TextureUvs(); /**
     * An array of vertices
     *
     * @member {Float32Array}
     */ this . vertices = new Float32Array ( [ 0 , 0 , 200 , 0 , 200 , 200 , 0 , 200 ] ) ; /**
     * The Uvs of the quad
     *
     * @member {Float32Array}
     */ this . uvs = new Float32Array ( [ 0 , 0 , 1 , 0 , 1 , 1 , 0 , 1 ] ) ; //    var white = (0xFFFFFF >> 16) + (0xFFFFFF & 0xff00) + ((0xFFFFFF & 0xff) << 16) + (1 * 255 << 24); //TODO convert this to a 32 unsigned int array /**
     * The color components of the triangles
     *
     * @member {Float32Array}
     */ this . colors = new Float32Array ( [ 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 , 1 ] ) ; /*
     * @member {Uint16Array} An array containing the indices of the vertices
     */ this . indices = new Uint16Array ( [ 0 , 1 , 2 , 0 , 3 , 2 ] ) ; /*
     * @member {WebGLBuffer} The vertex buffer
     */ this . vertexBuffer = gl . createBuffer ( ) ; /*
     * @member {WebGLBuffer} The index buffer
     */ this . indexBuffer = gl . createBuffer ( ) ; gl . bindBuffer ( gl . ARRAY_BUFFER , this . vertexBuffer ) ; gl . bufferData ( gl . ARRAY_BUFFER , ( 8 + 8 + 16 ) * 4 , gl . DYNAMIC_DRAW ) ; gl . bindBuffer ( gl . ELEMENT_ARRAY_BUFFER , this . indexBuffer ) ; gl . bufferData ( gl . ELEMENT_ARRAY_BUFFER , this . indices , gl . STATIC_DRAW ) ; this . upload ( ) ; }
Helper class to create a quad
@class
@memberof PIXI
@param gl {WebGLRenderingContext} The gl context for this quad to use.
Helper class to create a quad