Skip to content

Commit

Permalink
helpers: Replace com_ptr with ComPtr.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfonseca committed Apr 15, 2021
1 parent f497bc3 commit d0090c3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
12 changes: 8 additions & 4 deletions helpers/d3d10size.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@

#include <algorithm>

#include <wrl/client.h>

#include "dxgisize.hpp"
#include "com_ptr.hpp"


using Microsoft::WRL::ComPtr;


inline UINT
Expand Down Expand Up @@ -269,13 +273,13 @@ _getQueryType(ID3D10Query *pQuery)
static inline D3D10_QUERY
_getQueryType(ID3D10Asynchronous *pAsync)
{
com_ptr<ID3D10Query> pQuery;
ComPtr<ID3D10Query> pQuery;
HRESULT hr;
hr = pAsync->QueryInterface(IID_ID3D10Query, (void **)&pQuery);
hr = pAsync->QueryInterface(IID_ID3D10Query, &pQuery);
if (FAILED(hr)) {
return (D3D10_QUERY)-1;
}
return _getQueryType(pQuery);
return _getQueryType(pQuery.Get());
}


12 changes: 8 additions & 4 deletions helpers/d3d11size.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,12 @@

#include <algorithm>

#include <wrl/client.h>

#include "dxgisize.hpp"
#include "com_ptr.hpp"


using Microsoft::WRL::ComPtr;


inline UINT
Expand Down Expand Up @@ -271,13 +275,13 @@ _getQueryType(ID3D11Query *pQuery)
static inline D3D11_QUERY
_getQueryType(ID3D11Asynchronous *pAsync)
{
com_ptr<ID3D11Query> pQuery;
ComPtr<ID3D11Query> pQuery;
HRESULT hr;
hr = pAsync->QueryInterface(IID_ID3D11Query, (void **)&pQuery);
hr = pAsync->QueryInterface(IID_ID3D11Query, &pQuery);
if (FAILED(hr)) {
return (D3D11_QUERY)-1;
}
return _getQueryType(pQuery);
return _getQueryType(pQuery.Get());
}


0 comments on commit d0090c3

Please sign in to comment.