Esempio n. 1
0
        /// <summary>
        /// Draw the <see cref="ModelMesh"/>.
        /// </summary>
        /// <param name="context"></param>
        public void Draw(ModelDrawContext context)
        {
            try {
                if (Program == null)
                {
                    Program = new ModelProgram();
                    VertexDeclaration.Bind(Program, this, VertexSize);
                    Material.Bind(context, Program);
                }

                Program.Projection  = context.Projection;
                Program.View        = context.View;
                Program.World       = context.World;
                Program.DisplayMode = context.DisplayMode;
                DetailLevels[0].Draw(context, Program);
            } catch (Exception exception) {
                throw exception;
            }
        }