Headers are generated from Win32 Metadata .winmd file (included in repo).
Headers have minor changes to make them to compile as C code - whenever there is overloaded method with same name, it has incrementing number appended to name.
For example, interface ID2D1DeviceContext has CreateBitmap method, but
its parent interface ID2D1RenderTarget also has CreateBitmap method - with
different arguments. So whichever method comes last is renamed to CreateBitmap1
. In this case it will be
ID2D1DeviceContext_CreateBitmap1
method.
Some methods have more overloads, so to use them you will need to append suffix with 2, 3, 4, 5 or larger number.
Generated headers have proper workaround for wrong return types violating COM ABI. Read Direct 2D Scene of the Accident for more information.
Run dotnet run --project Generator
. It will write output cd2d.h
and cdwrite.h
files.