#pragma once #ifdef _WIN32 #include #if defined(WINAPI_FAMILY) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP #define WINDOWS_STORE 1 #else #define WINDOWS_STORE 0 #endif #include #include #include template using ComPtr = Microsoft::WRL::ComPtr; template static inline ComPtr* ReferenceComPtr(ComPtr& ptr) { return reinterpret_cast*>(ptr.GetAddressOf()); } #endif #include #include #include #ifndef ENABLE_BITWISE_ENUM #define ENABLE_BITWISE_ENUM(type) \ constexpr type operator|(type a, type b) noexcept { \ using T = std::underlying_type_t; \ return type(static_cast(a) | static_cast(b)); \ } \ constexpr type operator&(type a, type b) noexcept { \ using T = std::underlying_type_t; \ return type(static_cast(a) & static_cast(b)); \ } \ constexpr type& operator|=(type& a, type b) noexcept { \ using T = std::underlying_type_t; \ a = type(static_cast(a) | static_cast(b)); \ return a; \ } \ constexpr type& operator&=(type& a, type b) noexcept { \ using T = std::underlying_type_t; \ a = type(static_cast(a) & static_cast(b)); \ return a; \ } \ constexpr type operator~(type key) noexcept { \ using T = std::underlying_type_t; \ return type(~static_cast(key)); \ } \ constexpr bool True(type key) noexcept { \ using T = std::underlying_type_t; \ return static_cast(key) != 0; \ } \ constexpr bool False(type key) noexcept { \ return !True(key); \ } #endif namespace boo { #ifndef NDEBUG #define __BooTraceArgs , const char *file, int line #define __BooTraceArgsUse , file, line #define __BooTraceInitializer , m_file(file), m_line(line) #define __BooTraceFields \ const char* m_file; \ int m_line; #define BooTrace , __FILE__, __LINE__ #else #define __BooTraceArgs #define __BooTraceArgsUse #define __BooTraceInitializer #define __BooTraceFields #define BooTrace #endif } // namespace boo