Living without D3DX – D3D8,D3D9,D3D10,D3D11,OpenGL

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 ( ), 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 ( ), 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 ( )  to simply API call, and use  glVertexPointer,glTexCoordPointer,glDrawArrays to render.


helpful books/documents/websites:

<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:


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s