【发布时间】:2022-01-15 21:37:33
【问题描述】:
我目前正在为一个大学项目尝试在 DirectX 11 中使 UI 透明,并且正在查看 Microsoft 文档中的混合状态和其他资源。我不断遇到pd3dDevice,我真的迷失了它是什么。我找了很多地方只是为了看到人们在使用它,但没有提及它是什么。
我首先在这里找到它:Configuring Blending Functionality: Create the Blend State,我正在尝试找到一种使用它或以任何方式访问它的方法,但我找不到它是什么或它引用了什么。
ID3D11BlendState1* g_pBlendStateNoBlend = NULL;
D3D11_BLEND_DESC1 BlendState;
ZeroMemory(&BlendState, sizeof(D3D11_BLEND_DESC1));
BlendState.RenderTarget[0].BlendEnable = FALSE;
BlendState.RenderTarget[0].RenderTargetWriteMask =
D3D11_COLOR_WRITE_ENABLE_ALL;
pd3dDevice->CreateBlendState1(&BlendState, &g_pBlendStateNoBlend);
【问题讨论】:
-
首先我要问你对 DirectX 11 了解多少?你能创建一个基本的应用程序吗?因为如果可以,你就不会问这个问题。为了回答你的问题,我会说在做任何事情之前先学习 DirectX 的基础知识,所以我建议你阅读 Frank Luna 的“使用 DirectX 11 进行 3D 游戏编程简介”
标签: c++ directx-11 alphablending blending