CircularBuffer ClassDelta Engine Documentation
Provides a way to render lots of small batches inside a much larger circular vertex buffer. Each buffer uses one shader with a specific vertex format plus a blend mode and draw mode. http://blogs.msdn.com/b/shawnhar/archive/2010/07/07/setdataoptions-nooverwrite-versus-discard.aspx View code on GitHub
Inheritance Hierarchy

System Object
  DeltaEngine.Graphics CircularBuffer
    DeltaEngine.Graphics.BaseOpenGL11 OpenGL11CircularBuffer
    DeltaEngine.Graphics.BaseOpenGL20 OpenGL20CircularBuffer
    DeltaEngine.Graphics.Mocks MockCircularBuffer
    DeltaEngine.Graphics.SharpDX SharpDXCircularBuffer
    DeltaEngine.Graphics.SlimDX SlimDXCircularBuffer
    DeltaEngine.Graphics.Xna XnaCircularBuffer

Namespace: DeltaEngine.Graphics
Assembly: DeltaEngine.Graphics (in DeltaEngine.Graphics.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public abstract class CircularBuffer : IDisposable

The CircularBuffer type exposes the following members.

Constructors

  NameDescription
Protected methodCircularBuffer
Initializes a new instance of the CircularBuffer class
Top
Methods

  NameDescription
Public methodAdd VertexType 
Adds a short list of vertices (a quad or precomputed vertices for Particles), indices can be null for lines or when indices should be computed automatically for quads (0,1,2,0,2,3). View code on GitHub
Protected methodAddDataNative VertexType 
Protected methodBufferIsFullResetToBeginning
Some frameworks will overwrite this to set the buffer to discard mode, which is otherwise in NoOverwrite mode for better GPU performance when adding data at the end of the buffer. View code on GitHub
Protected methodComputeIndices
Protected methodCreateNative
Public methodDispose
Protected methodDisposeNative
Protected methodDisposeNextFrame
Public methodDisposeUnusedBuffersFromPreviousFrame
Public methodDrawAllTextureChunks
After all draw calls have been collected for this blend mode and shader they all drawn here. View code on GitHub
Protected methodDrawChunk
Protected methodDrawEverythingWhenBufferIsFull
Protected methodRemapIndices
Top
Fields

  NameDescription
Public fieldblendMode
Protected fieldcachedQuadIndices
Protected fielddevice
Protected fielddrawMode
Protected fieldindexSize
Protected fieldisCreated
Protected fieldmaxNumberOfIndices
Protected fieldmaxNumberOfVertices
Public fieldshader
Protected fieldtotalIndexOffsetInBytes
Protected fieldtotalIndicesCount
Public fieldStatic memberTotalMaximumVerticesLimit
Protected fieldtotalVertexOffsetInBytes
Protected fieldtotalVerticesCount
Protected fieldvertexSize
Top
Properties

  NameDescription
Public propertyIs3D
Public propertyNumberOfActiveVertices
Protected propertyUsesIndexBuffer
Protected propertyUsesTexturing
Top
Remarks

Tests: DeltaEngine.Graphics.Tests.CircularBufferTests
Examples

21 unit tests call DeltaEngine.Graphics.CircularBuffer
[Test, CloseAfterFirstFrame, Timeout(5000)]
public void CreateAndDisposeBuffer()
{
    buffer2D.Dispose();
    Assert.IsFalse(buffer2D.IsCreated);
}
[Test, CloseAfterFirstFrame, Timeout(5000)]
public void BufferCanBe2DOr3D()
{
    Assert.IsFalse(buffer2D.Is3D);
    Assert.IsTrue(buffer3D.Is3D);
}
[Test, CloseAfterFirstFrame]
public void OffsetInitialization()
{
    Assert.AreEqual(0, buffer2D.VertexOffset);
    Assert.AreEqual(0, buffer2D.IndexOffset);
}
See Also