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 ( 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.

d3d

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.

 

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>

https://www.opengl.org/sdk/docs/

https://msdn.microsoft.com/en-us/library/windows/desktop/ee663274(v=vs.85).aspx

 

helpful open source projects:

https://github.com/mumble-voip/mumble

https://github.com/jp9000/obs-studio

https://github.com/Microsoft/DirectXTK

http://glew.sourceforge.net/

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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