memononen/nanovg — pull request #103 by cmaughan (2014-06-09 16:12:24+00:00)
Title: D3D Renderer

This is a D3D renderer I was playing with a while back. I updated the demo so it works also.
I don't know if you're interested in a D3D version, but it's here if you want it. I realize that would add maintenance headaches, and may not be of interest to some folks...

Notes:
- I didn't get the latest FBO rendering in the demo, with the little backbuffer.
- This D3D 11 only. I didn't look at DX9.
- There are some ugly macros to make D3D11 API calls from C or CPP. I couldn't figure out a better way to do it.
- There is slightly less high quality rendering on the edges of the 'eyes' - I don't know why. It is very slight... perhaps a pixel center issue.
- I haven't added the newer pixel kill stuff (not sure what that affects - perf or quality?)
- I made this before the significant change to the gl3 backend to do the rendering in flush. I think my approach is probably similar, but I may go back and do another pass to pull in the cleaner code that exists there now.
- D3D requires that you compile shaders to headers if you want to use them in WinRT or on the phone. I don't know how to markup the premake file to do that; but it's easy to add the .hlsl files and compile then in visual studio, which supports this natively. My pull request has precompiled headers and HLSL's too.
![d3d](https://cloud.githubusercontent.com/assets/120447/3218971/910c76bc-eff0-11e3-95d2-b5b1dc925446.png)