The code sample from D3D12HelloWorld compiles normally for me : DXSampleHelper.h
with std::exception() from VS 2022 install directory (Microsoft Visual Studio_2020 on my PC...)
E:\Program Files\Microsoft Visual Studio_2020\VC\Tools\MSVC\14.34.31933\include\vcruntime_exception.h
I have a question regarding the definition to the ThrowIfFailed() function used in DirectX12 code applications.
In the course of coding DirectX12 applications, I find frequent references to the ThrowIfFailed() function, but I have not not been able to get the definition that is given in the Helpers.h header file to compile:
define WIN32_LEAN_AND_MEAN
include <Windows.h> // For HRESULT
// From DXSampleHelper.h
// Source: https://github.com/Microsoft/DirectX-Graphics-Samples
inline void ThrowIfFailed(HRESULT hr)
{
if (FAILED(hr))
{
throw std::exception();
}
}
Including this definition in my DX12 code results in my compiler flagging the exception() function as not being a part of the STD namespace.
So, I have three questions regarding this - Is the principle reason for the ThrowIfFailed() function to provide a breakpoint in DX12 code (as I have read), and secondly, where can I find a reference to a definition that does compile?
My third question involves the use of TAGS in this forum - I have not yet figured out the labeling hierarchy used in tags that are available for questions - for instance, I discovered there is no DirectX12 tag for this post, so I am using the closest thing I find. Where do I find more about choosing appropriate tags?
-
Castorix31 81,721 Reputation points
2022-11-29T18:59:39.95+00:00