/// <summary>
        /// The render.
        /// </summary>
        /// <param name="model">
        /// The model.
        /// </param>
        /// <param name="flags">
        /// The flags.
        /// </param>
        /// <returns>
        /// The render.
        /// </returns>
        public override uint Render(CIwModel model, uint flags)
        {
            CIwMaterial material = model.GetMaterial(this.m_MaterialID);

            if (material != null)
            {
                material.Enable();
            }

            S3E.CheckOpenGLStatus();
            GL.Begin(BeginMode.Triangles);

            var verts     = model.ResolveBlock <CIwModelBlockVerts>();
            var colors    = model.ResolveBlock <CIwModelBlockCols>();
            var normals   = model.ResolveBlock <CIwModelBlockNorms>();
            var indGroups = model.ResolveBlock <CIwModelBlockIndGroups>();

            if (verts != null)
            {
                foreach (var iwModelPrim in this.prims)
                {
                    iwModelPrim.Render(model, flags, verts, indGroups, colors);
                }
            }

            GL.End();
            if (material != null)
            {
                material.Disable();
            }

            S3E.CheckOpenGLStatus();

            return(0);
        }
Example #2
0
        /// <summary>
        /// The render.
        /// </summary>
        /// <param name="model">
        /// The model.
        /// </param>
        /// <param name="flags">
        /// The flags.
        /// </param>
        /// <returns>
        /// The render.
        /// </returns>
        public override uint Render(CIwModel model, uint flags)
        {
            try
            {
                CIwMaterial material = model.GetMaterial(this.materialId);
                if (material != null)
                {
                    material.Enable();
                }

                S3E.CheckOpenGLStatus();
                GL.Begin(BeginMode.Triangles);
                base.Render(model, flags);
                GL.End();
                if (material != null)
                {
                    material.Disable();
                }

                S3E.CheckOpenGLStatus();
            }
            catch (Exception ex)
            {
                throw;
            }

            return(0);
        }
Example #3
0
        /// <summary>
        /// The render.
        /// </summary>
        /// <param name="model">
        /// The model.
        /// </param>
        /// <param name="flags">
        /// The flags.
        /// </param>
        /// <returns>
        /// The render.
        /// </returns>
        public override uint Render(CIwModel model, uint flags)
        {
            CIwMaterial material = model.GetMaterial(this.materialId);

            if (material != null)
            {
                material.Enable();
            }

            GL.Begin(BeginMode.TriangleStrip);
            base.Render(model, flags);
            GL.End();
            S3E.CheckOpenGLStatus();

            if (material != null)
            {
                material.Disable();
            }

            return(0);
        }