mirror of
https://github.com/microsoft/DirectXTex.git
synced 2025-07-13 13:40:14 +02:00
Use IID_PPV_ARGS macro
This commit is contained in:
parent
842c9aff1d
commit
51e92d4e5d
@ -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;
|
||||
|
@ -37,6 +37,10 @@
|
||||
|
||||
#include "ScreenGrab.h"
|
||||
|
||||
#ifndef IID_GRAPHICS_PPV_ARGS
|
||||
#define IID_GRAPHICS_PPV_ARGS(x) IID_PPV_ARGS(x)
|
||||
#endif
|
||||
|
||||
using Microsoft::WRL::ComPtr;
|
||||
|
||||
//--------------------------------------------------------------------------------------
|
||||
@ -614,7 +618,7 @@ static HRESULT CaptureTexture( _In_ ID3D11DeviceContext* pContext,
|
||||
return HRESULT_FROM_WIN32( ERROR_NOT_SUPPORTED );
|
||||
|
||||
ComPtr<ID3D11Texture2D> pTexture;
|
||||
HRESULT hr = pSource->QueryInterface( __uuidof(ID3D11Texture2D), reinterpret_cast<void**>( pTexture.GetAddressOf() ) );
|
||||
HRESULT hr = pSource->QueryInterface( IID_GRAPHICS_PPV_ARGS( pTexture.GetAddressOf() ) );
|
||||
if ( FAILED(hr) )
|
||||
return hr;
|
||||
|
||||
@ -726,8 +730,7 @@ static IWICImagingFactory* _GetWIC()
|
||||
CLSID_WICImagingFactory1,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWICImagingFactory),
|
||||
(LPVOID*)&s_Factory
|
||||
IID_PPV_ARGS(&s_Factory)
|
||||
);
|
||||
|
||||
if ( FAILED(hr) )
|
||||
@ -741,8 +744,7 @@ static IWICImagingFactory* _GetWIC()
|
||||
CLSID_WICImagingFactory,
|
||||
nullptr,
|
||||
CLSCTX_INPROC_SERVER,
|
||||
__uuidof(IWICImagingFactory),
|
||||
(LPVOID*)&s_Factory
|
||||
IID_PPV_ARGS(&s_Factory)
|
||||
);
|
||||
|
||||
if ( FAILED(hr) )
|
||||
|
@ -568,7 +568,7 @@ bool CreateDevice( _Outptr_ ID3D11Device** pDevice )
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
ComPtr<IDXGIDevice> dxgiDevice;
|
||||
hr = (*pDevice)->QueryInterface( __uuidof( IDXGIDevice ), reinterpret_cast< void** >( dxgiDevice.GetAddressOf() ) );
|
||||
hr = (*pDevice)->QueryInterface( IID_PPV_ARGS( dxgiDevice.GetAddressOf() ) );
|
||||
if ( SUCCEEDED(hr) )
|
||||
{
|
||||
ComPtr<IDXGIAdapter> pAdapter;
|
||||
|
Loading…
x
Reference in New Issue
Block a user