public void PurgeDrawManager() { graphicsDevice = null; SpriteBatch = null; blendStates.Clear(); depthEnableStencilState = null; depthDisableStencilState = null; effectStack.Clear(); PrimitiveEffect = null; AlphaTestEffect = null; defaultEffect = null; currentEffect = null; currentRenderTarget = null; quadsBuffer = null; quadsIndexBuffer = null; currentTexture = null; quadsVertices = null; quadsIndices = null; TmpVertices.Clear(); }
void CheckQuadsVertexBuffer(int capacity) { if (quadsBuffer == null || quadsBuffer.Capacity < capacity) { capacity = Math.Max(capacity, DefaultQuadBufferSize); if (quadsBuffer == null) { quadsBuffer = new CCQuadVertexBuffer(capacity, CCBufferUsage.WriteOnly); } else { quadsBuffer.Capacity = capacity; } } }
public CCTextureAtlas(CCTexture2D texture, int capacity) { Texture = texture; // Re-initialization is not allowed Debug.Assert(Quads == null); if (capacity < 4) { capacity = 4; } vertexBuffer = new CCQuadVertexBuffer(capacity, CCBufferUsage.WriteOnly); Quads = vertexBuffer.Data; Dirty = true; }