forked from MoonsideGames/MoonWorks
add a few useful functions
parent
66d363459b
commit
2bd88e1dc1
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Converts radians to degrees.
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue