/// <summary> /// Initializes a new instance of the <see cref="XnaObjectRenderer"/> class. /// </summary> /// <param name="device">The device.</param> /// <param name="effect">The effect.</param> /// <param name="bufferBindings">The buffer bindings.</param> public XnaObjectRenderer(GraphicsDevice device, IEffect effect, IEnumerable<BufferBinding> bufferBindings) { mBufferBindings = bufferBindings; mDevice = device; mEffect = effect.DowncastTo<XnaEffect>(); foreach (var bufferBinding in bufferBindings) { var description = bufferBinding.Description; if (description.Usage == GraphicStreamUsage.Index) { mIndexCount = description.Count; } if (description.Usage == GraphicStreamUsage.Position) { mVertexCount = description.Count; } } }