diff --git a/src/Graphics/RefreshStructs.cs b/src/Graphics/RefreshStructs.cs index 4f0ef76..9fb19eb 100644 --- a/src/Graphics/RefreshStructs.cs +++ b/src/Graphics/RefreshStructs.cs @@ -12,6 +12,12 @@ namespace MoonWorks.Graphics public float Depth; public uint Stencil; + public DepthStencilValue(float depth, uint stencil) + { + Depth = depth; + Stencil = stencil; + } + // FIXME: can we do an unsafe cast somehow? public Refresh.DepthStencilValue ToRefresh() { @@ -157,6 +163,30 @@ namespace MoonWorks.Graphics public LoadOp LoadOp; public StoreOp StoreOp; + public ColorAttachmentInfo(Texture texture, Color clearColor, StoreOp storeOp = StoreOp.Store) + { + Texture = texture; + Depth = 0; + Layer = 0; + Level = 0; + SampleCount = SampleCount.One; + ClearColor = clearColor; + LoadOp = LoadOp.Clear; + StoreOp = storeOp; + } + + public ColorAttachmentInfo(Texture texture, StoreOp storeOp = StoreOp.Store) + { + Texture = texture; + Depth = 0; + Layer = 0; + Level = 0; + SampleCount = SampleCount.One; + ClearColor = Color.White; + LoadOp = LoadOp.DontCare; + StoreOp = StoreOp.Store; + } + public Refresh.ColorAttachmentInfo ToRefresh() { return new Refresh.ColorAttachmentInfo @@ -192,6 +222,19 @@ namespace MoonWorks.Graphics public LoadOp StencilLoadOp; public StoreOp StencilStoreOp; + public DepthStencilAttachmentInfo(Texture texture, DepthStencilValue clearValue) + { + Texture = texture; + Depth = 0; + Layer = 0; + Level = 0; + DepthStencilClearValue = clearValue; + LoadOp = LoadOp.Clear; + StoreOp = StoreOp.DontCare; + StencilLoadOp = LoadOp.DontCare; + StencilStoreOp = StoreOp.DontCare; + } + public Refresh.DepthStencilAttachmentInfo ToRefresh() { return new Refresh.DepthStencilAttachmentInfo