External dependencies and no header include

Category: windows metro apps games


Lloyd on Tue, 11 Sep 2012 14:05:48

I'm trying to delve into the joys of DirectX and C++ programming on Windows 8.
(I'm a DirectX newbie and C++ rusty)

My first "test / learning project" is a plain / vanilla D3D project (it shows a rotating cube out of the box, when created)

My first modification is to make it work in XAML, I get my inspiration from the "simple3DGameXaml" sample, at:

My problem: as I copy paste code from the XAML sample I notice it has members of type D2D interfaces (such as: ID2D1Device)


I can't see an "#include <d2d1.h>" in the DirectXBase.h or referenced headers... and I can't see d2d1.h in the external dependencies of my project!!

What kind of witchery is that? no include! How could I make it work in my project too!!??


Lloyd on Tue, 11 Sep 2012 14:12:09

Found it, this is "precompiled header / pch.h magic"!!!!

Just edited the "pch.h" file to include the D2D headers.

Chuck Walbourn - MSFT on Tue, 11 Sep 2012 18:26:12

See http://msdn.microsoft.com/en-us/library/szfdksca.aspx

Lloyd on Wed, 12 Sep 2012 01:12:43

Thanks Chuck, nice read!