#pragma once #include #include 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 void safeRelease(T*& obj) { if (obj != nullptr) { obj->Release(); obj = nullptr; } }