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
9
11JPH_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
12JPH_MSVC_SUPPRESS_WARNING(4625) // 'X': copy constructor was implicitly defined as deleted
13JPH_MSVC_SUPPRESS_WARNING(4626) // 'X': assignment operator was implicitly defined as deleted
14JPH_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
15JPH_MSVC_SUPPRESS_WARNING(5220) // 'X': a non-static data member with a volatile qualified type no longer implies
16JPH_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
17#include <d3d12.h>
18#include <dxgi1_6.h>
19#include <dxgidebug.h>
20#include <wrl.h>
22
24
25using Microsoft::WRL::ComPtr;
26
27template <class Result>
28inline bool HRFailed(HRESULT inHR, Result &outResult)
29{
30 if (SUCCEEDED(inHR))
31 return false;
32
33 String error = StringFormat("Call failed with error code: %08X", inHR);
34 outResult.SetError(error);
35 JPH_ASSERT(false);
36 return true;
37}
38
39inline bool HRFailed(HRESULT inHR)
40{
41 if (SUCCEEDED(inHR))
42 return false;
43
44 Trace("Call failed with error code: %08X", inHR);
45 JPH_ASSERT(false);
46 return true;
47}
48
#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
bool HRFailed(HRESULT inHR, Result &outResult)
Definition IncludeDX12.h:28
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