小编wla*_*r86的帖子

DirectX::SpriteFont/SpriteBatch 阻止 3D 场景绘制

DirectX::SpriteFont我在使用/时遇到问题DirectX::SpriteBatch(来自 DirectXTK;与此处讨论的问题完全相同:Problems while Drawing text using the SpriteFont class)。

void DrawScene(void)
{
    HRESULT hr;

    float bgColor_a[4] = { 0.0f, 0.4f, 0.8f, 0.0f };

    g_pDeviceContext->ClearRenderTargetView(g_pRenderTargetView, bgColor_a);
    g_pDeviceContext->ClearDepthStencilView(g_pDepthStencilView, D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL, 1.0f, 0);

    XMMATRIX cameraProj = XMLoadFloat4x4(&g_camera._cameraProjection);
    XMVECTOR pos = XMLoadFloat3(&g_camera._pos);
    XMVECTOR target = XMLoadFloat3(&g_camera._target);
    XMVECTOR up = XMLoadFloat3(&g_camera._up);
    XMMATRIX cameraView = XMMatrixLookAtLH(pos, target, up);
    XMMATRIX worldBox2 = XMMatrixIdentity() * (XMMatrixTranslation(2.0f, 0.0f, 0.0f) * XMMatrixRotationY(XMConvertToRadians(g_rotBox2)));
    XMMATRIX wvp = worldBox2 * cameraView * cameraProj;
    XMMATRIX transposeWvp = XMMatrixTranspose(wvp); …
Run Code Online (Sandbox Code Playgroud)

c++ 3d directx-11 spritefont

1
推荐指数
1
解决办法
1561
查看次数

标签 统计

3d ×1

c++ ×1

directx-11 ×1

spritefont ×1