mirror of
https://github.com/microsoft/DirectXTex.git
synced 2026-02-07 05:26:12 +01:00
Use IID_PPV_ARGS macro
This commit is contained in:
@@ -19,6 +19,10 @@
|
||||
#include <d3d10.h>
|
||||
#endif
|
||||
|
||||
#ifndef IID_GRAPHICS_PPV_ARGS
|
||||
#define IID_GRAPHICS_PPV_ARGS(x) IID_PPV_ARGS(x)
|
||||
#endif
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
namespace DirectX
|
||||
@@ -43,7 +47,7 @@ static HRESULT _Capture( _In_ ID3D11DeviceContext* pContext, _In_ ID3D11Resource
|
||||
return hr;
|
||||
|
||||
ComPtr<ID3D11DeviceContextX> d3dContextX;
|
||||
hr = pContext->QueryInterface( __uuidof(ID3D11DeviceContextX), reinterpret_cast<void**>( d3dContextX.GetAddressOf() ) );
|
||||
hr = pContext->QueryInterface( IID_GRAPHICS_PPV_ARGS( d3dContextX.GetAddressOf() ) );
|
||||
if ( FAILED(hr) )
|
||||
return hr;
|
||||
|
||||
@@ -698,7 +702,7 @@ HRESULT CaptureTexture( ID3D11Device* pDevice, ID3D11DeviceContext* pContext, ID
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE1D:
|
||||
{
|
||||
ComPtr<ID3D11Texture1D> pTexture;
|
||||
hr = pSource->QueryInterface( __uuidof(ID3D11Texture1D), reinterpret_cast<void**>( pTexture.GetAddressOf() ) );
|
||||
hr = pSource->QueryInterface( IID_GRAPHICS_PPV_ARGS( pTexture.GetAddressOf() ) );
|
||||
if ( FAILED(hr) )
|
||||
break;
|
||||
|
||||
@@ -742,7 +746,7 @@ HRESULT CaptureTexture( ID3D11Device* pDevice, ID3D11DeviceContext* pContext, ID
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE2D:
|
||||
{
|
||||
ComPtr<ID3D11Texture2D> pTexture;
|
||||
hr = pSource->QueryInterface( __uuidof(ID3D11Texture2D), reinterpret_cast<void**>( pTexture.GetAddressOf() ) );
|
||||
hr = pSource->QueryInterface( IID_GRAPHICS_PPV_ARGS( pTexture.GetAddressOf() ) );
|
||||
if ( FAILED(hr) )
|
||||
break;
|
||||
|
||||
@@ -843,7 +847,7 @@ HRESULT CaptureTexture( ID3D11Device* pDevice, ID3D11DeviceContext* pContext, ID
|
||||
case D3D11_RESOURCE_DIMENSION_TEXTURE3D:
|
||||
{
|
||||
ComPtr<ID3D11Texture3D> pTexture;
|
||||
hr = pSource->QueryInterface( __uuidof(ID3D11Texture3D), reinterpret_cast<void**>( pTexture.GetAddressOf() ) );
|
||||
hr = pSource->QueryInterface( IID_GRAPHICS_PPV_ARGS( pTexture.GetAddressOf() ) );
|
||||
if ( FAILED(hr) )
|
||||
break;
|
||||
|
||||
|
||||
@@ -259,8 +259,7 @@ IWICImagingFactory* GetWICFactory(bool& iswic2)
|
||||
CLSID_WICImagingFactory1,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWICImagingFactory),
|
||||
(LPVOID*)&g_Factory
|
||||
IID_PPV_ARGS(&g_Factory)
|
||||
);
|
||||
|
||||
if (FAILED(hr))
|
||||
@@ -274,8 +273,7 @@ IWICImagingFactory* GetWICFactory(bool& iswic2)
|
||||
CLSID_WICImagingFactory,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWICImagingFactory),
|
||||
(LPVOID*)&g_Factory
|
||||
IID_PPV_ARGS(&g_Factory)
|
||||
);
|
||||
|
||||
g_WIC2 = false;
|
||||
@@ -305,7 +303,7 @@ void SetWICFactory(_In_opt_ IWICImagingFactory* pWIC)
|
||||
{
|
||||
#if(_WIN32_WINNT >= _WIN32_WINNT_WIN8) || defined(_WIN7_PLATFORM_UPDATE)
|
||||
ComPtr<IWICImagingFactory2> wic2;
|
||||
HRESULT hr = pWIC->QueryInterface(_uuidof(IWICImagingFactory2), reinterpret_cast<void**>(wic2.GetAddressOf()));
|
||||
HRESULT hr = pWIC->QueryInterface(IID_PPV_ARGS(wic2.GetAddressOf()));
|
||||
if (SUCCEEDED(hr))
|
||||
{
|
||||
iswic2 = true;
|
||||
|
||||
Reference in New Issue
Block a user