TestFramework.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <Jolt/Jolt.h>
  5. // Targetting Windows 10 and above
  6. #define WINVER 0x0A00
  7. #define _WIN32_WINNT 0x0A00
  8. // Disable common warnings
  9. JPH_SUPPRESS_WARNINGS
  10. JPH_CLANG_SUPPRESS_WARNING("-Wheader-hygiene")
  11. JPH_SUPPRESS_WARNING_PUSH
  12. 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.
  13. 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
  14. 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
  15. 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
  16. 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
  17. #define WIN32_LEAN_AND_MEAN
  18. #define Ellipse DrawEllipse // Windows.h defines a name that we would like to use
  19. #include <windows.h>
  20. #undef Ellipse
  21. #undef min // We'd like to use std::min and max instead of the ones defined in windows.h
  22. #undef max
  23. #undef DrawText // We don't want this to map to DrawTextW
  24. #include <d3d12.h>
  25. #include <dxgi1_6.h>
  26. #include <wrl.h> // for ComPtr
  27. JPH_SUPPRESS_WARNING_POP
  28. using Microsoft::WRL::ComPtr;
  29. using namespace JPH;
  30. using namespace std;