diff --git a/src/Graphics/RefreshStructs.cs b/src/Graphics/RefreshStructs.cs index 518db0a0..6bd0c845 100644 --- a/src/Graphics/RefreshStructs.cs +++ b/src/Graphics/RefreshStructs.cs @@ -281,6 +281,24 @@ namespace MoonWorks.Graphics StencilStoreOp = StoreOp.DontCare; } + public DepthStencilAttachmentInfo( + Texture texture, + LoadOp loadOp = LoadOp.DontCare, + StoreOp storeOp = StoreOp.Store, + LoadOp stencilLoadOp = LoadOp.DontCare, + StoreOp stencilStoreOp = StoreOp.Store + ) { + Texture = texture; + Depth = 0; + Layer = 0; + Level = 0; + DepthStencilClearValue = new DepthStencilValue(); + LoadOp = loadOp; + StoreOp = storeOp; + StencilLoadOp = stencilLoadOp; + StencilStoreOp = stencilStoreOp; + } + public Refresh.DepthStencilAttachmentInfo ToRefresh() { return new Refresh.DepthStencilAttachmentInfo diff --git a/src/Graphics/State/VertexInputState.cs b/src/Graphics/State/VertexInputState.cs index a984219f..7ca93efe 100644 --- a/src/Graphics/State/VertexInputState.cs +++ b/src/Graphics/State/VertexInputState.cs @@ -8,6 +8,12 @@ public VertexBinding[] VertexBindings; public VertexAttribute[] VertexAttributes; + public VertexInputState() + { + VertexBindings = new VertexBinding[0]; + VertexAttributes = new VertexAttribute[0]; + } + public VertexInputState( VertexBinding vertexBinding, params VertexAttribute[] vertexAttributes diff --git a/src/Math/MathHelper.cs b/src/Math/MathHelper.cs index 15518ac7..5d582f25 100644 --- a/src/Math/MathHelper.cs +++ b/src/Math/MathHelper.cs @@ -280,6 +280,11 @@ namespace MoonWorks.Math return result; } + public static float Quantize(float value, float step) + { + return (float) System.Math.Floor(value / step) * step; + } + /// /// Converts radians to degrees. ///