using System;
using Microsoft.Xna.Framework.Graphics;
namespace MonoGame.Extended.Graphics
{
///
/// The exception that is thrown when enqueuing vertices or indices into a
/// results in an overflow.
///
/// The vertex type.
///
public class GeometryBufferOverflowException : Exception
where TVertexType : struct, IVertexType
{
internal GeometryBufferOverflowException(GeometryBuffer geometryBuffer, int verticesCountToAdd,
int indicesCountToAdd)
: base(
$"The GeometryBuffer could not enqueue the requested {verticesCountToAdd} vertices or {indicesCountToAdd} indices since it is full full with {geometryBuffer._vertexCount} (out of {geometryBuffer.MaximumVerticesCount}) vertices and {geometryBuffer._indexCount} (out of {geometryBuffer.MaximumIndicesCount}) indices. Consider increasing the maximum number of vertices or indices when instantiating the GeometryBuffer, flushing the GeometryBuffer if it's dynamic, or using multiple GeometryBuffers to accommodate the requested enqueue."
)
{
}
}
}