public ArrayPoolAllocator <T> GetArrayAllocator <T> () { var t = typeof(T); IArrayPoolAllocator o; lock (_ArrayAllocators) _ArrayAllocators.TryGetValue(t, out o); ArrayPoolAllocator <T> result; if (o == null) { result = new ArrayPoolAllocator <T>(); lock (_ArrayAllocators) { if (!_ArrayAllocators.TryGetValue(t, out o)) { _ArrayAllocators[t] = result; } else { result = (ArrayPoolAllocator <T>)o; } } } else { result = (ArrayPoolAllocator <T>)o; } return(result); }
new public void Initialize(IBatchContainer container, int layer, Material material) { base.Initialize(container, layer, material, true); if (VertexAllocator == null) { VertexAllocator = container.RenderManager.GetArrayAllocator <GeometryVertex>(); } if (IndexAllocator == null) { IndexAllocator = container.RenderManager.GetArrayAllocator <short>(); } Count = VertexCount = IndexCount = 0; }
public void Initialize( IBatchContainer container, int layer, Material material, SamplerState samplerState = null, SamplerState samplerState2 = null, bool useZBuffer = false, int?capacity = null ) { base.Initialize(container, layer, material, capacity); SamplerState = samplerState ?? SamplerState.LinearClamp; SamplerState2 = samplerState2 ?? SamplerState.LinearClamp; _Allocator = container.RenderManager.GetArrayAllocator <BitmapVertex>(); UseZBuffer = useZBuffer; }