Why my texture can't show up in full screen mode DX11 game
I'm drawing a texture in a DX11 game. It's strange that the texture never shows up in the full screen mode.
I list my state setting here for reference.
BOOL BlendEnable[] = {TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE};
UINT8 RenderTargetWriteMask[] = {0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF, 0xF};
D3D11_BLEND_DESC bs11 = {0};
bs11.AlphaToCoverageEnable = 0;
bs11.IndependentBlendEnable = false;
for(size_t i = sizeof(BlendEnable) / sizeof(BlendEnable[0]); i--;)
{
bs11.RenderTarget[i].BlendEnable = BlendEnable[i];
bs11.RenderTarget[i].RenderTargetWriteMask = RenderTargetWriteMask[i];
}
bs11.RenderTarget[0].BlendOp = D3D10_DDI_BLEND_OP_ADD;
bs11.RenderTarget[0].BlendOpAlpha = D3D10_DDI_BLEND_OP_ADD;
bs11.RenderTarget[0].DestBlend = D3D10_DDI_BLEND_INV_SRC_ALPHA;
bs11.RenderTarget[0].DestBlendAlpha = D3D10_DDI_开发者_如何学编程BLEND_ZERO;
bs11.RenderTarget[0].SrcBlend = D3D10_DDI_BLEND_SRC_ALPHA;
bs11.RenderTarget[0].SrcBlendAlpha = D3D10_DDI_BLEND_ONE;
bs11.RenderTarget[0].RenderTargetWriteMask = D3D10_DDI_COLOR_WRITE_ENABLE_ALL;
D3D11_DEPTH_STENCIL_DESC depthDesc;
depthDesc.DepthEnable = 0;
depthDesc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ZERO;
depthDesc.DepthFunc = D3D10_COMPARISON_NEVER;
depthDesc.BackEnable = 0;
depthDesc.FrontEnable = 0;
depthDesc.StencilEnable = 0;
depthDesc.StencilReadMask = 0;
depthDesc.StencilWriteMask = 0;
depthDesc.FrontFace.StencilDepthFailOp = D3D10_DDI_STENCIL_OP_KEEP;
depthDesc.FrontFace.StencilFailOp = D3D10_DDI_STENCIL_OP_KEEP;
depthDesc.FrontFace.StencilFunc = D3D10_DDI_COMPARISON_ALWAYS;
depthDesc.FrontFace.StencilPassOp = D3D10_DDI_STENCIL_OP_KEEP;
depthDesc.BackFace.StencilDepthFailOp = D3D10_DDI_STENCIL_OP_KEEP;
depthDesc.BackFace.StencilFailOp = D3D10_DDI_STENCIL_OP_KEEP;
depthDesc.BackFace.StencilFunc = D3D10_DDI_COMPARISON_ALWAYS;
depthDesc.BackFace.StencilPassOp = D3D10_DDI_STENCIL_OP_KEEP;
What's the most likely issue it can be?
Thanks, Marshall
Not sure if this will solve your issues but the D3D11_BLEND_DESC/D3D11_DEPTH_STENCIL_DESC variables are being set as D3D10_ flags as far as I know this usually compiles but should be the D3D11_ equivalent.
So the texture shows under windowed mode?
精彩评论