TestFramework.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // Jolt Physics Library (https://github.com/jrouwe/JoltPhysics)
  2. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  3. // SPDX-License-Identifier: MIT
  4. #pragma once
  5. #include <Jolt/Jolt.h>
  6. // Targetting Windows 10 and above
  7. #define WINVER 0x0A00
  8. #define _WIN32_WINNT 0x0A00
  9. // Disable common warnings
  10. JPH_SUPPRESS_WARNINGS
  11. JPH_CLANG_SUPPRESS_WARNING("-Wheader-hygiene")
  12. #ifdef JPH_DOUBLE_PRECISION
  13. JPH_CLANG_SUPPRESS_WARNING("-Wdouble-promotion")
  14. #endif // JPH_DOUBLE_PRECISION
  15. JPH_SUPPRESS_WARNING_PUSH
  16. JPH_MSVC_SUPPRESS_WARNING(5039) // winbase.h(13179): warning C5039: 'TpSetCallbackCleanupGroup': pointer or reference to potentially throwing function passed to 'extern "C"' function under -EHc. Undefined behavior may occur if this function throws an exception.
  17. JPH_MSVC_SUPPRESS_WARNING(5204) // implements.h(65): warning C5204: 'Microsoft::WRL::CloakedIid<IMarshal>': class has virtual functions, but its trivial destructor is not virtual; instances of objects derived from this class may not be destructed correctly
  18. JPH_MSVC_SUPPRESS_WARNING(4265) // implements.h(1449): warning C4265: 'Microsoft::WRL::FtmBase': class has virtual functions, but its non-trivial destructor is not virtual; instances of this class may not be destructed correctly
  19. JPH_MSVC_SUPPRESS_WARNING(5220) // implements.h(1648): warning C5220: 'Microsoft::WRL::Details::RuntimeClassImpl<Microsoft::WRL::RuntimeClassFlags<2>,true,false,true,IWeakReference>::refcount_': a non-static data member with a volatile qualified type no longer implies
  20. JPH_MSVC_SUPPRESS_WARNING(4986) // implements.h(2343): warning C4986: 'Microsoft::WRL::Details::RuntimeClassImpl<RuntimeClassFlagsT,true,true,false,I0,TInterfaces...>::GetWeakReference': exception specification does not match previous declaration
  21. #define WIN32_LEAN_AND_MEAN
  22. #define Ellipse DrawEllipse // Windows.h defines a name that we would like to use
  23. #include <windows.h>
  24. #undef Ellipse
  25. #undef min // We'd like to use std::min and max instead of the ones defined in windows.h
  26. #undef max
  27. #undef DrawText // We don't want this to map to DrawTextW
  28. #include <d3d12.h>
  29. #include <dxgi1_6.h>
  30. #include <wrl.h> // for ComPtr
  31. JPH_SUPPRESS_WARNING_POP
  32. using Microsoft::WRL::ComPtr;
  33. using namespace JPH;
  34. using namespace JPH::literals;
  35. using namespace std;