capitalize struct fields

pull/14/head
cosmonaut 2021-01-27 14:02:57 -08:00
parent 5524e501f3
commit 9b06225d7d
1 changed files with 48 additions and 57 deletions

View File

@ -9,16 +9,16 @@ namespace MoonWorks.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct DepthStencilValue public struct DepthStencilValue
{ {
public float depth; public float Depth;
public uint stencil; public uint Stencil;
// FIXME: can we do an unsafe cast somehow? // FIXME: can we do an unsafe cast somehow?
public Refresh.DepthStencilValue ToRefresh() public Refresh.DepthStencilValue ToRefresh()
{ {
return new Refresh.DepthStencilValue return new Refresh.DepthStencilValue
{ {
depth = depth, depth = Depth,
stencil = stencil stencil = Stencil
}; };
} }
} }
@ -26,103 +26,94 @@ namespace MoonWorks.Graphics
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Rect public struct Rect
{ {
public int x; public int X;
public int y; public int Y;
public int w; public int W;
public int h; public int H;
// FIXME: can we do an unsafe cast somehow? // FIXME: can we do an unsafe cast somehow?
public Refresh.Rect ToRefresh() public Refresh.Rect ToRefresh()
{ {
return new Refresh.Rect return new Refresh.Rect
{ {
x = x, x = X,
y = y, y = Y,
w = w, w = W,
h = h h = H
}; };
} }
} }
[StructLayout(LayoutKind.Sequential)]
public struct Vec4
{
public float x;
public float y;
public float z;
public float w;
}
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct Viewport public struct Viewport
{ {
public float x; public float X;
public float y; public float Y;
public float w; public float W;
public float h; public float H;
public float minDepth; public float MinDepth;
public float maxDepth; public float MaxDepth;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct VertexBinding public struct VertexBinding
{ {
public uint binding; public uint Binding;
public uint stride; public uint Stride;
public VertexInputRate inputRate; public VertexInputRate InputRate;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct VertexAttribute public struct VertexAttribute
{ {
public uint location; public uint Location;
public uint binding; public uint Binding;
public VertexElementFormat format; public VertexElementFormat Format;
public uint offset; public uint Offset;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct ColorTargetDescription public struct ColorTargetDescription
{ {
public TextureFormat format; public TextureFormat Format;
public SampleCount multisampleCount; public SampleCount MultisampleCount;
public LoadOp loadOp; public LoadOp LoadOp;
public StoreOp storeOp; public StoreOp StoreOp;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct DepthStencilTargetDescription public struct DepthStencilTargetDescription
{ {
public TextureFormat depthFormat; public TextureFormat Format;
public LoadOp loadOp; public LoadOp LoadOp;
public StoreOp storeOp; public StoreOp StoreOp;
public LoadOp stencilLoadOp; public LoadOp StencilLoadOp;
public StoreOp stencilStoreOp; public StoreOp StencilStoreOp;
} }
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct StencilOpState public struct StencilOpState
{ {
public StencilOp failOp; public StencilOp FailOp;
public StencilOp passOp; public StencilOp PassOp;
public StencilOp depthFailOp; public StencilOp DepthFailOp;
public CompareOp compareOp; public CompareOp CompareOp;
public uint compareMask; public uint CompareMask;
public uint writeMask; public uint WriteMask;
public uint reference; public uint Reference;
// FIXME: can we do an explicit cast here? // FIXME: can we do an explicit cast here?
public Refresh.StencilOpState ToRefresh() public Refresh.StencilOpState ToRefresh()
{ {
return new Refresh.StencilOpState return new Refresh.StencilOpState
{ {
failOp = (Refresh.StencilOp)failOp, failOp = (Refresh.StencilOp)FailOp,
passOp = (Refresh.StencilOp)passOp, passOp = (Refresh.StencilOp)PassOp,
depthFailOp = (Refresh.StencilOp)depthFailOp, depthFailOp = (Refresh.StencilOp)DepthFailOp,
compareOp = (Refresh.CompareOp)compareOp, compareOp = (Refresh.CompareOp)CompareOp,
compareMask = compareMask, compareMask = CompareMask,
writeMask = writeMask, writeMask = WriteMask,
reference = reference reference = Reference
}; };
} }
} }