Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
IncludeDX12.h
Go to the documentation of this file.
1// Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
2// SPDX-FileCopyrightText: 2025 Jorrit Rouwe
3// SPDX-License-Identifier: MIT
4
5#pragma once
6
7#ifdef JPH_USE_DX12
8
11
13JPH_MSVC_SUPPRESS_WARNING(4265) // 'X': class has virtual functions, but its non-trivial destructor is not virtual; instances of this class may not be destructed correctly
14JPH_MSVC_SUPPRESS_WARNING(4625) // 'X': copy constructor was implicitly defined as deleted
15JPH_MSVC_SUPPRESS_WARNING(4626) // 'X': assignment operator was implicitly defined as deleted
16JPH_MSVC_SUPPRESS_WARNING(5204) // 'X': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly
17JPH_MSVC_SUPPRESS_WARNING(5220) // 'X': a non-static data member with a volatile qualified type no longer implies
18JPH_MSVC2026_PLUS_SUPPRESS_WARNING(4865) // wingdi.h(2806,1): '<unnamed-enum-DISPLAYCONFIG_OUTPUT_TECHNOLOGY_OTHER>': the underlying type will change from 'int' to '__int64' when '/Zc:enumTypes' is specified on the command line
19#include <d3d12.h>
20#include <dxgi1_6.h>
21#include <dxgidebug.h>
22#include <wrl.h>
24
26
27using Microsoft::WRL::ComPtr;
28
29template <class Result>
30inline bool HRFailed(HRESULT inHR, Result &outResult)
31{
32 if (SUCCEEDED(inHR))
33 return false;
34
35 String error = StringFormat("Call failed with error code: %08X", inHR);
36 outResult.SetError(error);
37 JPH_ASSERT(false);
38 return true;
39}
40
41inline bool HRFailed(HRESULT inHR)
42{
43 if (SUCCEEDED(inHR))
44 return false;
45
46 Trace("Call failed with error code: %08X", inHR);
47 JPH_ASSERT(false);
48 return true;
49}
50
52
53#endif // JPH_USE_DX12
#define JPH_SUPPRESS_WARNINGS_STD_BEGIN
Definition Core.h:430
#define JPH_SUPPRESS_WARNINGS_STD_END
Definition Core.h:443
#define JPH_NAMESPACE_END
Definition Core.h:425
#define JPH_MSVC2026_PLUS_SUPPRESS_WARNING(w)
Definition Core.h:332
#define JPH_MSVC_SUPPRESS_WARNING(w)
Definition Core.h:330
#define JPH_NAMESPACE_BEGIN
Definition Core.h:419
TraceFunction Trace
Definition IssueReporting.cpp:14
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
std::basic_string< char, std::char_traits< char >, STLAllocator< char > > String
Definition STLAllocator.h:107
JPH_SUPPRESS_WARNINGS_STD_BEGIN JPH_SUPPRESS_WARNINGS_STD_END JPH_NAMESPACE_BEGIN String StringFormat(const char *inFMT,...)
Definition StringTools.cpp:15
Helper class that either contains a valid result or an error.
Definition Result.h:12
void SetError(const char *inError)
Set an error value.
Definition Result.h:152