locked
Why ComPtr<IDXGISwapChain1> instead of ComPtr<IDXGISwapChain> or IDXGISwapChain*

    Question

  • I guess ComPtr might serve as a smart pointer, but why IDXGISwapChain1, instead of IDXGISwapChain? The trailing character "1" is a bit mysterious.
    Monday, June 25, 2012 5:16 PM

Answers

All replies

  • IDXGISwapChain1 is the new DXGI 1.2 version of the interface which adds some additional capabilities, specifically things required for Metro style apps.

    http://msdn.microsoft.com/en-us/library/windows/desktop/hh404631.aspx
    • Marked as answer by Leonard Tuesday, June 26, 2012 3:57 AM
    Monday, June 25, 2012 6:15 PM
  • The name is confusing to me as well, this will be changed in the future? Something like IDXGISwapChainEx ? 

    Thanks.



    Tuesday, July 10, 2012 5:53 PM
  • But then what would "version 3" be? "IDXGISwapChainExEx"? "IDXGISwapChainEx2"?

    This pattern has been in use for some time:

    ID3D10Device is Direct3D 10.0

    ID3D10Device1 is Direct3D 10.1

    ID3D11Device is Direct3D 11.0

    ID3D11Device1 is Direct3D 11.1

    Generally you can use the 'standard' version and not require the extended one so this is typically invisible unless you specifically need the new functionalty. The thing is that Metro style apps specifically need the extended SwapChain interface to work with ICoreWindow. 

    Tuesday, July 10, 2012 9:39 PM