Example #1
0
        /// <summary>
        /// Make sure we have room for some new data
        /// </summary>
        /// <param name="vertices"></param>
        /// <param name="points"></param>
        public bool Allocate(int vertices, int points)
        {
            bool moreSpaceAllocated = false;

            if (fTriangles.Count == 0)
            {
                fTriangles.Add(new PrimitiveTriangles());
                moreSpaceAllocated = true;
            }
            else
            {
                PrimitiveTriangles primitive = fTriangles[fTriangles.Count - 1];
                if (primitive.GetAvailableTriangleIndices() < points || primitive.GetAvailableVertices() < vertices)
                {
                    fTriangles.Add(new PrimitiveTriangles());
                    moreSpaceAllocated = true;
                }
            }
            return(moreSpaceAllocated);
        }
Example #2
0
        public short AddTriangle(int index1, int index2, int index3)
        {
            PrimitiveTriangles primitive = fTriangles[fTriangles.Count - 1];

            return(primitive.AddTriangle((short)index1, (short)index2, (short)index3));
        }
Example #3
0
        public short AddVertice(VertexPositionNormalColor vertex)
        {
            PrimitiveTriangles primitive = fTriangles[fTriangles.Count - 1];

            return(primitive.AddVertice(vertex));
        }