Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17560

Modifying Frank Luna's Box demo for DirectX12 to print a 2D chart

$
0
0

I am studying Frank Luna's book and, as 'self-imposed' exercise I am trying to modify his Box demo code to draw a 2D chart, whatever, for example a line connecting few points. I replaced this line:

207    mCommandList->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST);

with this:

207    mCommandList->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_LINESTRIP);

and I also replaced this line:

456    psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;

with this one:

456    psoDesc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_LINE;

I also built an indices file:

std::array<std::uint16_t, 14> indices =
    {
        0, 1, 

        1, 2,

        2, 3,

        3, 4,

        4, 5,

        5, 6,

        6, 7
        
    };

The compiler does not give errors, the window open but remains blank and …


Viewing all articles
Browse latest Browse all 17560

Trending Articles