Learning DirectX and C++: Step 2, Initialise DirectX
Saturday, January 9th, 2010In order to make the most simple use of DirectX we must set up the required infrastructure. This is as follows:
- A swap chain (at least two areas of memory, one for drawing into, one for displaying to the screen).
- A RenderTargetView (a reference to the area of memory from the swap chain for drawing into).
- A Depth/Stencil buffer, and a view onto it. (Used to help decided whether any given pixel should be drawn).
- Bind the RT (RenderTarget) and Depth/Stencil views to an Output Merger stage.
- Set the Viewport (a sub-rectangle of the BackBuffer that we will draw to).
Naturally after we have set up this infrastructure we have repeatedly draw some sort of scene; we will get to that after we have discussed the topics above.