Allow passing a material name to QuadC.
authorJoe Wreschnig <joe.wreschnig@gmail.com>
Tue, 23 Sep 2014 16:16:30 +0000 (18:16 +0200)
committerJoe Wreschnig <joe.wreschnig@gmail.com>
Tue, 23 Sep 2014 16:16:30 +0000 (18:16 +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);
+            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);