DrawArrays() private method

private DrawArrays ( uint mode, int first, int count ) : void
mode uint
first int
count int
return void
Exemplo n.º 1
0
 public override void Render(RenderEventArgs arg, ShaderProgram shaderProgram)
 {
     if (arg.RenderMode == RenderModes.ColorCodedPicking &&
         arg.PickingGeometryType == GeometryType.Point &&
         this.Mode.ToGeometryType() == GeometryType.Line)   // picking point from a line
     {
         // this maybe render points that should not appear.
         // so need to select by another picking
         OpenGL.DrawArrays(DrawMode.Points, this.FirstVertex, this.VertexCount);
     }
     else
     {
         OpenGL.DrawArrays(this.Mode, this.FirstVertex, this.VertexCount);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="arg"></param>
        public override void Render(RenderEventArgs arg)
        {
            uint mode = 0;

            if (arg.PickingGeometryType == PickingGeometryType.Point &&
                this.Mode.ToGeometryType() == PickingGeometryType.Line)   // picking point from a line
            {
                // this maybe render points that should not appear.
                // so need to select by another picking.
                mode = (uint)DrawMode.Points;
            }
            else
            {
                mode = (uint)this.Mode;
            }

            int primCount = this.PrimCount;

            if (primCount < 1)
            {
                throw new Exception("error: primCount is less than 1.");
            }
            else if (primCount == 1)
            {
                OpenGL.DrawArrays(mode, this.FirstVertex, this.RenderingVertexCount);
            }
            else
            {
                if (glDrawArraysInstanced == null)
                {
                    glDrawArraysInstanced = OpenGL.GetDelegateFor <OpenGL.glDrawArraysInstanced>();
                }

                glDrawArraysInstanced(mode, this.FirstVertex, this.RenderingVertexCount, primCount);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        ///
        /// </summary>
        public override void Render()
        {
            uint mode = (uint)this.Mode;

            int primCount = this.PrimCount;

            if (primCount < 1)
            {
                throw new Exception("error: primCount is less than 1.");
            }
            else if (primCount == 1)
            {
                OpenGL.DrawArrays(mode, this.FirstVertex, this.RenderingVertexCount);
            }
            else
            {
                if (glDrawArraysInstanced == null)
                {
                    glDrawArraysInstanced = OpenGL.GetDelegateFor <OpenGL.glDrawArraysInstanced>();
                }

                glDrawArraysInstanced(mode, this.FirstVertex, this.RenderingVertexCount, primCount);
            }
        }