19 explicit HResultException(HRESULT hr) : std::runtime_error(FormatHResultMessage(hr)), mHResult(hr) {
23 : std::runtime_error(context +
" " + FormatHResultMessage(hr)), mHResult(hr) {
34 static std::string FormatHResultMessage(HRESULT hr) {
36 std::snprintf(buf,
sizeof(buf),
"HRESULT failure: 0x%08X",
static_cast<unsigned int>(hr));
Exception type for failed Windows HRESULT values.
Definition HResultException.h:17
HResultException(HRESULT hr)
Definition HResultException.h:19
HResultException(HRESULT hr, const std::string &context)
Definition HResultException.h:22
HRESULT GetHResult() const noexcept
Returns the raw HRESULT value.
Definition HResultException.h:27
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14