/// <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; }
/// <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; } } }