Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public ZeroIndexBuffer GetIndexBuffer()
        {
            if (this.buffer == null)
            {
                this.buffer = ZeroIndexBuffer.Create(this.Mode, this.FirstVertex, this.VertexCount, this.PrimCount);
            }

            return(this.buffer);
        }
Example #2
0
        public IndexBuffer GetIndexBuffer()
        {
            if (this.indexBuffer == null)
            {
                this.indexBuffer = ZeroIndexBuffer.Create(DrawMode.TriangleStrip, 0, positions.Length);
            }

            return(this.indexBuffer);
        }
        public IndexBuffer GetIndexBuffer()
        {
            if (this.indexBuffer == null)
            {
                this.indexBuffer = ZeroIndexBuffer.Create(DrawMode.Quads, 0, 4);
            }

            return(this.indexBuffer);
        }
Example #4
0
 public CSharpGL.IndexBuffer GetIndexBuffer()
 {
     if (this.indexBuffer == null)
     {
         int             vertexCount = this.pointCount;
         ZeroIndexBuffer buffer      = ZeroIndexBuffer.Create(DrawMode.Points, 0, vertexCount);
         this.indexBuffer = buffer;
     }
     return(this.indexBuffer);
 }
Example #5
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public CSharpGL.IndexBuffer GetIndexBuffer()
 {
     if ((indexBuffer == null))
     {
         int             vertexCount = this.pointPositions.Length;
         ZeroIndexBuffer buffer      = ZeroIndexBuffer.Create(DrawMode.Points, 0, vertexCount);
         this.indexBuffer = buffer;
     }
     return(indexBuffer);
 }
        public IndexBuffer GetIndexBuffer()
        {
            if (this.indexBuffer == null)
            {
                int             uCount = GetUCount(interval);
                ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(DrawMode.Points, 0, uCount);
                this.indexBuffer = buffer;
            }

            return(this.indexBuffer);
        }
Example #7
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public IndexBuffer GetIndexBuffer()
        {
            if (this.indexBuffer == null)
            {
                int             vertexCount = maxCharCount * 4;
                ZeroIndexBuffer buffer      = ZeroIndexBuffer.Create(DrawMode.Quads, 0, vertexCount);
                this.indexBuffer = buffer;
            }

            return(this.indexBuffer);
        }
Example #8
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public IndexBuffer GetIndexBuffer()
        {
            if (this.indexBuffer == null)
            {
                int             vertexCount = positions.Length;
                ZeroIndexBuffer buffer      = ZeroIndexBuffer.Create(DrawMode.Lines, 0, vertexCount);
                this.indexBuffer = buffer;
            }

            return(this.indexBuffer);
        }
Example #9
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public IndexBuffer GetIndexBuffer()
        {
            if (indexBuffer == null)
            {
                ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(DrawMode.LineStrip, 0, BigDipperModel.positions.Length);

                this.indexBuffer = buffer;
            }

            return(indexBuffer);
        }
Example #10
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public IndexBuffer GetIndexBuffer()
        {
            if (this.indexBuffer == null)
            {
                int             vertexCount = this.model.positions.Length;
                ZeroIndexBuffer buffer      = ZeroIndexBuffer.Create(this.model.GetDrawModel(), 0, vertexCount);
                this.indexBuffer = buffer;
            }

            return(this.indexBuffer);
        }
Example #11
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public IndexBuffer GetIndexBuffer()
        {
            if (this.indexBuffer == null)
            {
                int primCount  = 1;
                int frameCount = 2;
                this.indexBuffer = ZeroIndexBuffer.Create(DrawMode.Quads, 0, positions.Length, primCount, frameCount);
            }

            return(this.indexBuffer);
        }
Example #12
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public IndexBuffer GetIndexBuffer()
        {
            if (this.indexBuffer == null)
            {
                int vertexCount = this.model.Positions.Length;
                ZeroIndexBuffer buffer = ZeroIndexBuffer.Create(DrawMode.LineStrip, 0, vertexCount);
                this.indexBuffer = buffer;
            }

            return this.indexBuffer;
        }
Example #13
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public IndexBuffer GetIndexBuffer()
        {
            if (this.indexBuffer == null)
            {
                int primCount   = 1;
                int frameCount  = 1;
                var indexBuffer = ZeroIndexBuffer.Create(DrawMode.Quads, 0, this.Capacity * 4, primCount, frameCount);
                // note: use ZeroIndexBuffer.Draw(ControlMode.Random) to enable this property.
                indexBuffer.RenderingVertexCount = 0;
                this.indexBuffer = indexBuffer;
            }

            return(this.indexBuffer);
        }
        /// <summary>
        ///
        /// </summary>
        /// <param name="arg"></param>
        /// <param name="lastVertexId"></param>
        /// <param name="picker"></param>
        /// <returns></returns>
        internal override uint Search(PickingEventArgs arg,
                                      uint lastVertexId, ZeroIndexPicker picker)
        {
            var zeroIndexBuffer = picker.Node.PickingRenderUnit.VertexArrayObject.IndexBuffer as ZeroIndexBuffer;
            // when the temp index buffer could be long, it's no longer needed.
            // what a great OpenGL API design!
            ZeroIndexBuffer indexBuffer = ZeroIndexBuffer.Create(DrawMode.Points, zeroIndexBuffer.FirstVertex, zeroIndexBuffer.RenderingVertexCount, zeroIndexBuffer.InstanceCount);

            picker.Node.Render4InnerPicking(arg, indexBuffer);
            uint id = ColorCodedPicking.ReadStageVertexId(arg.X, arg.Y);

            indexBuffer.Dispose();

            if (zeroIndexBuffer.FirstVertex <= id &&
                id < zeroIndexBuffer.FirstVertex + zeroIndexBuffer.RenderingVertexCount)
            {
                return(id);
            }
            else
            {
                throw new Exception("This should not happen!");
            }
        }
Example #15
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="arg"></param>
        /// <param name="x">mouse position(Left Down is (0, 0)).</param>
        /// <param name="y">mouse position(Left Down is (0, 0)).</param>
        /// <param name="lastVertexId"></param>
        /// <param name="modernRenderer"></param>
        /// <returns></returns>
        internal override uint Search(RenderEventArgs arg,
                                      int x, int y,
                                      uint lastVertexId, ZeroIndexRenderer modernRenderer)
        {
            ZeroIndexBuffer zeroIndexBuffer = modernRenderer.IndexBuffer;
            // when the temp index buffer could be long, it's no longer needed.
            // what a great OpenGL API design!
            ZeroIndexBuffer indexBuffer = ZeroIndexBuffer.Create(DrawMode.Points, zeroIndexBuffer.FirstVertex, zeroIndexBuffer.RenderingVertexCount, zeroIndexBuffer.PrimCount);

            modernRenderer.Render4InnerPicking(arg, indexBuffer);
            uint id = ColorCodedPicking.ReadStageVertexId(x, y);

            indexBuffer.Dispose();

            if (zeroIndexBuffer.FirstVertex <= id &&
                id < zeroIndexBuffer.FirstVertex + zeroIndexBuffer.RenderingVertexCount)
            {
                return(id);
            }
            else
            {
                throw new Exception("This should not happen!");
            }
        }