Microsoft has released a toolkit for directx since Directx 11, it can be used to replace legacy d3dx library which is useful but closed-source, of course it also has limitations.
In this article ( https://blogs.msdn.microsoft.com/chuckw/2013/08/20/living-without-d3dx/ ), Microsoft didn’t give a workable solution for previous verisons of DirectX. They just let you to update to DirectX 11.
However, thanks to DirectX Toolkit ( https://github.com/Microsoft/DirectXTK ), we can port it to previous versions of DirectX.
DirectX 11: use DirectXTK.
DirectX 10: It is almost the same as D3D11 in API level, the major difference is D3D10 doesn’t have a device context (ID3D11DeviceContext), so all those function are located in device (ID3D10Device).
DirectX 9: unlike DirectX 10, DirectX9 is very different from DirectX 11. We use CreateVertexDeclaration/SetVertexDeclaration to control input layout, and use DrawPrimitiveUP to render the final vertexes.
DirectX 8: it is very easy to support after we have supported DirectX 9, because DirectX is fix pipeline, we can simply use SetVertexShader to describe vertexes, and still use DrawPrimitiveUP to render the final vertexes.
More, we also support OpenGL, I didn’t write a complete class for it, but the main concept is similar.
we render everything in a texture, and render the element in one go.
OpenGL: I use glew ( http://glew.sourceforge.net/ ) to simply API call, and use glVertexPointer,glTexCoordPointer,glDrawArrays to render.
<Advanced 3D Game Programming Using DirectX 9.0>
<Introduction to 3D Game Programming with DirectX 10>
<Beginning C++ Through Game Programming>
helpful open source projects: