Esempio n. 1
0
        public Expression CompileVertexAttribExplicit(AstVertexAttribExplicit e)
        {
            var type = NameResolver.GetType(Namescope, e.Type);
            var args = CompileArgumentList(e.Arguments);

            if (args.Length < 4)
            {
                return(Error(e.Source, ErrorCode.E0000, "Minimum 4 arguments are required for 'vertex_attrib'"));
            }

            return(new NewVertexAttrib(e.Source, type,
                                       CompileImplicitCast(args[0].Source, "Uno.Graphics.VertexAttributeType", args[0]),
                                       CompileImplicitCast(args[1].Source, "Uno.Graphics.VertexBuffer", args[1]),
                                       CompileImplicitCast(args[2].Source, Essentials.Int, args[2]),
                                       CompileImplicitCast(args[3].Source, Essentials.Int, args[3]),
                                       args.Length > 4
                    ? CompileImplicitCast(args[4].Source, "Uno.Graphics.IndexType", args[4])
                    : null,
                                       args.Length > 5
                    ? CompileImplicitCast(args[5].Source, "Uno.Graphics.IndexBuffer", args[5])
                    : null));
        }
Esempio n. 2
0
 public void WriteVertexAttribExplicit(AstVertexAttribExplicit a)
 {
     Write(a.Source);
     Write(a.Type);
     WriteArguments(a.Arguments);
 }