For some reason I seem to be unable to initialize my RenderTargetView
(it stays NULL
) which causes an access violation.
Here is the line that should initialize the RenderTargetView:
hr = g_pd3dDevice->CreateRenderTargetView(pBackBuffer, NULL, &g_pRenderTargetView);
pBackBuffer
is the Back buffer and it gets a value, it isn't NULL
. However, the rendertagetview stays NULL
throughout the process. Any idea why?
In order to trace the DirectX11 errors, you'd better to create the D3D11 device with the debug layer, it will print the error message to output window in Visual Studio when you launch your app.