Support passing a material name to QuadC.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Sat, 6 Sep 2014 10:26:38 +0000 (12:26 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Sat, 6 Sep 2014 10:26:38 +0000 (12:26 +0200)
src/yuu/rdr.js

index a03cbec56482b6274583b09a581ec5082e425591..99b8c3f56e142499432dda1612a56e170fec7c2e 100644 (file)
         constructor: function (material) {
             var buffer = new yuu.VertexBuffer(yuu.V3T2C4_F, 4);
             this._quad = new yuu.Quad(buffer);
         constructor: function (material) {
             var buffer = new yuu.VertexBuffer(yuu.V3T2C4_F, 4);
             this._quad = new yuu.Quad(buffer);
+            material = yf.isString(material)
+                ? new yuu.Material(material)
+                : material;
             this._rdro = new yuu.Renderable(
                 buffer, yuu.gl.TRIANGLE_STRIP, material,
                 { model: mat4.create() }, 0.0);
             this._rdro = new yuu.Renderable(
                 buffer, yuu.gl.TRIANGLE_STRIP, material,
                 { model: mat4.create() }, 0.0);