In 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.
Continue reading “Learning DirectX and C++: Step 2, Initialise DirectX”
I planned, quite some time ago now, to start writing a series covering my journey, well I’ve finally gotten round to the first bit of it. Hopefully I’ll write a bit more frequently than I have recently, but we’ll see – I’m not making any promises.
I’ve bought some books on C++ and DirectX and have started working through them. The book I am working through at the moment Introduction to 3D Game Programming with DirectX 10, has based its demos on a small, bespoke application framework. Whilst this is all well and good, I find that I learn by doing, by writing the programs myself, rather than reviewing demo code. So, I’ll be starting from scratch, writing my own, similar application framework, following the lessons in the book, and blogging about it here. So, onto “Step one, create a window”. Continue reading “Learning C++ and DirectX: Step one, create a window.”