Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="InstancedModel"/> class.
        /// </summary>
        public InstancedModel(GraphicsDevice graphicsDevice, ISupportInstancing template)
        {
            if (graphicsDevice == null)
            {
                throw new ArgumentNullException("graphicsDevice");
            }

            GraphicsDevice = graphicsDevice;
            Template       = template;
        }
Пример #2
0
 /// <summary>
 /// Releases unmanaged and - optionally - managed resources
 /// </summary>
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (instanceBuffer != null)
         {
             instanceBuffer.Dispose();
             instanceBuffer = null;
         }
         if (vertexDeclaration != null)
         {
             vertexDeclaration.Dispose();
             vertexDeclaration = null;
         }
         if (template is IDisposable)
         {
             ((IDisposable)template).Dispose();
             template = null;
         }
     }
 }