Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ AllocateBuffers()

void Microsoft.Xna.Framework.Graphics.SpriteBatch.AllocateBuffers ( )
inlineprivate

Definition at line 164 of file SpriteBatch.cs.

165 {
166 if (vertexBuffer == null || vertexBuffer.IsDisposed)
167 {
168 vertexBuffer = new DynamicVertexBuffer(_parent, typeof(VertexPositionColorTexture), 8192, BufferUsage.WriteOnly);
170 vertexBuffer.ContentLost += delegate
171 {
173 };
174 }
175 if (indexBuffer == null || indexBuffer.IsDisposed)
176 {
177 indexBuffer = new DynamicIndexBuffer(_parent, typeof(short), 12288, BufferUsage.WriteOnly);
178 indexBuffer.SetData(CreateIndexData());
179 indexBuffer.ContentLost += delegate
180 {
181 indexBuffer.SetData(CreateIndexData());
182 };
183 }
184 }

References Microsoft.Xna.Framework.Graphics.GraphicsResource._parent, Microsoft.Xna.Framework.Graphics.SpriteBatch.CreateIndexData(), Microsoft.Xna.Framework.Graphics.SpriteBatch.indexBuffer, Microsoft.Xna.Framework.Graphics.GraphicsResource.IsDisposed, Microsoft.Xna.Framework.Graphics.SpriteBatch.vertexBuffer, and Microsoft.Xna.Framework.Graphics.SpriteBatch.vertexBufferPosition.

Referenced by Microsoft.Xna.Framework.Graphics.SpriteBatch.ConstructPlatformData(), and Microsoft.Xna.Framework.Graphics.SpriteBatch.SetPlatformRenderState().