在我的书中,我编写了创建交换链的代码.
IDXGIDevice * dxgiDevice = 0;
mD3dDevice->QueryInterface( __uuidof( IDXGIDevice ),( void ** ) & dxgiDevice );
IDXGIAdapter * dxgiAdapter = 0;
dxgiDevice->GetParent( __uuidof( IDXGIAdapter ),( void ** ) & dxgiAdapter );
IDXGIFactory * dxgiFactory = 0;
dxgiAdapter->GetParent( __uuidof( IDXGIFactory ),( void ** ) & dxgiFactory );
dxgiFactory->CreateSwapChain( mD3dDevice, & sd, & mSwapChain );
Run Code Online (Sandbox Code Playgroud)
对于这段代码没有任何解释,我检查了很少的书籍,也有这个代码的noo解释.
请帮助mi.我真的不明白做什么做GetParent方法.idxgiDevice扩展idxgiObject.idxgiDevice的父级是idxgiObject,为什么它们使用指向idxgiFacory的指针作为参数.
我不知道我理解queryInterface好
请帮助mi