3
votes

Using the example:

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

This says ID2D1DeviceContext can be used for both Windows Store apps (Metro) as well as desktop apps and that it can be used to render to an HWND (c++ desktop app).

However, the example is specific to Windows::UI:Core::CoreWindow. (Windows Store/Metro)

This has the same. http://msdn.microsoft.com/en-us/library/windows/desktop/hh780340(v=vs.85).aspx

Any suggestions appreciated how to accomplish this, thanks!

K

1

1 Answers

0
votes

I was able to port the metro code over to desktop compatible code.

Used CComPtr in place of ComPtr. Removed the DX::ThrowIfFailed, you can use your own method of testing the HRESULTS Replaced .As with QueryInterface calls.

The one function change is: CreateSwapChainForHwnd in place of CreateSwapChainForCoreWindow