Files
hwr2023_a/GDP/D3D9/Utilities.h
T
2025-09-03 14:55:06 +02:00

27 lines
349 B
C++

#pragma once
#include <Windows.h>
#include <string>
void ShowError(UINT error);
#define CheckError(x) if (x != 0) \
{ \
ShowError(x); \
return x; \
}
#define CheckFailed(hr, x) if (FAILED(hr)) \
{ \
ShowError(x); \
return x; \
}
template<typename T>
void safeRelease(T*& obj)
{
if (obj != nullptr)
{
obj->Release();
obj = nullptr;
}
}