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
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
The CircularBuffer type exposes the following members.
Constructors
Name | Description | |
---|---|---|
CircularBuffer | Initializes a new instance of the CircularBuffer class |
Methods
Name | Description | |
---|---|---|
Add 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 | |
AddDataNative VertexType | ||
BufferIsFullResetToBeginning |
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 | |
ComputeIndices | ||
CreateNative | ||
Dispose | ||
DisposeNative | ||
DisposeNextFrame | ||
DisposeUnusedBuffersFromPreviousFrame | ||
DrawAllTextureChunks |
After all draw calls have been collected for this blend mode and shader they all drawn here.
View code on GitHub | |
DrawChunk | ||
DrawEverythingWhenBufferIsFull | ||
RemapIndices |
Fields
Properties
Name | Description | |
---|---|---|
Is3D | ||
NumberOfActiveVertices | ||
UsesIndexBuffer | ||
UsesTexturing |
Remarks
Examples
[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