Monday 2 July 2012

Errors & Omissions

In the last post I mentioned having to set the project up so that in has access to other DirectX libraries to avoid linker errors, and just to illustrate the errors you may encounter if you forget to link the needed libraries.
image
Now I have removed the d3d11.lib from we get the compile errors above, not too informative are they, in fact, there is nothing in there to make you think that this is an issue with a missing link library, well unless you are already a C++ programmer.
In the last post I also omitted a view port, so, lets fix that now. In our InitDevice method we can add this code after we have create the depth stencil view
// Setup the viewport
D3D11_VIEWPORT vp;
vp.Width = (FLOAT)width;
vp.Height = (FLOAT)height;
vp.MinDepth = 0.0f;
vp.MaxDepth = 1.0f;
vp.TopLeftX = 0;
vp.TopLeftY = 0;
pImmediateContext->RSSetViewports( 1, &vp );

No comments:

Post a Comment