/// <summary> /// Initializes a new instance of the <see cref="StatePoolManager"/> class. /// </summary> /// <param name="device">The device.</param> public StatePoolManager(Device device) { BlendStatePool = new BlendStatePool(device); RasterStatePool = new RasterStatePool(device); DepthStencilStatePool = new DepthStencilStatePool(device); SamplerStatePool = new SamplerStatePool(device); }
protected override void OnDispose(bool disposeManagedResources) { BlendStatePool.Dispose(); RasterStatePool.Dispose(); DepthStencilStatePool.Dispose(); SamplerStatePool.Dispose(); base.OnDispose(disposeManagedResources); }
/// <summary> /// Registers the specified desc. /// </summary> /// <param name="desc">The desc.</param> /// <returns></returns> public RasterizerStateProxy Register(RasterizerStateDescription desc) { return(RasterStatePool.Register(desc) as RasterizerStateProxy); }
/// <summary> /// Registers the specified desc. /// </summary> /// <param name="desc">The desc.</param> /// <returns></returns> public RasterizerStateProxy Register(RasterizerStateDescription desc) { return(RasterStatePool.TryCreateOrGet(desc, desc, out var state) ? state : null); }