public D3D11_SAMPLER_DESC(D3D11_FILTER filter, D3D11_TEXTURE_ADDRESS_MODE addressU, D3D11_TEXTURE_ADDRESS_MODE addressV, D3D11_TEXTURE_ADDRESS_MODE addressW, [NativeTypeName("FLOAT")] float mipLODBias, [NativeTypeName("UINT")] uint maxAnisotropy, D3D11_COMPARISON_FUNC comparisonFunc, [NativeTypeName("FLOAT [4]")] float *borderColor, [NativeTypeName("FLOAT")] float minLOD, [NativeTypeName("FLOAT")] float maxLOD) { Filter = filter; AddressU = addressU; AddressV = addressV; AddressW = addressW; MipLODBias = mipLODBias; MaxAnisotropy = maxAnisotropy; ComparisonFunc = comparisonFunc; var defaultColor = stackalloc float[4] { 1.0f, 1.0f, 1.0f, 1.0f }; if (borderColor == null) { borderColor = defaultColor; } BorderColor[0] = borderColor[0]; BorderColor[1] = borderColor[1]; BorderColor[2] = borderColor[2]; BorderColor[3] = borderColor[3]; MinLOD = minLOD; MaxLOD = maxLOD; } }
public D3D11_DEPTH_STENCIL_DESC(BOOL depthEnable, D3D11_DEPTH_WRITE_MASK depthWriteMask, D3D11_COMPARISON_FUNC depthFunc, BOOL stencilEnable, [NativeTypeName("UINT8")] byte stencilReadMask, [NativeTypeName("UINT8")] byte stencilWriteMask, D3D11_STENCIL_OP frontStencilFailOp, D3D11_STENCIL_OP frontStencilDepthFailOp, D3D11_STENCIL_OP frontStencilPassOp, D3D11_COMPARISON_FUNC frontStencilFunc, D3D11_STENCIL_OP backStencilFailOp, D3D11_STENCIL_OP backStencilDepthFailOp, D3D11_STENCIL_OP backStencilPassOp, D3D11_COMPARISON_FUNC backStencilFunc) { DepthEnable = depthEnable; DepthWriteMask = depthWriteMask; DepthFunc = depthFunc; StencilEnable = stencilEnable; StencilReadMask = stencilReadMask; StencilWriteMask = stencilWriteMask; FrontFace.StencilFailOp = frontStencilFailOp; FrontFace.StencilDepthFailOp = frontStencilDepthFailOp; FrontFace.StencilPassOp = frontStencilPassOp; FrontFace.StencilFunc = frontStencilFunc; BackFace.StencilFailOp = backStencilFailOp; BackFace.StencilDepthFailOp = backStencilDepthFailOp; BackFace.StencilPassOp = backStencilPassOp; BackFace.StencilFunc = backStencilFunc; }