https://github.com/ensisoft/wdk/blob/master/sample/triangle....
C++ tho, but i could port it, i'll give it a glance
https://github.com/ensisoft/wdk/blob/master/sample/triangle....