为什么我的纹理无法在全屏模式DX11游戏中显示出来

时间:2011-07-29 03:47:14

标签: fullscreen directx-11

我在DX11游戏中绘制纹理。奇怪的是纹理永远不会出现在全屏模式中。

我在此列出我的州设置以供参考。

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;

最可能出现的问题是什么?

谢谢, 马歇尔

1 个答案:

答案 0 :(得分:0)

不确定这是否会解决您的问题,但D3D11_BLEND_DESC / D3D11_DEPTH_STENCIL_DESC变量被设置为D3D10_标志,据我所知这通常编译但应该是D3D11_等效。

那么纹理在窗口模式下显示?