10 #define HN_PLATFORM_WINDOWS
13 #error "x86 Builds are not supported!"
15#elif defined(__APPLE__) || defined(__MACH__)
16 #include <TargetConditionals.h>
21 #if TARGET_IPHONE_SIMULATOR == 1
22 #error "IOS simulator is not supported!"
23 #elif TARGET_OS_IPHONE == 1
24 #define HN_PLATFORM_IOS
25 #error "IOS is not supported!"
26 #elif TARGET_OS_MAC == 1
27 #define HN_PLATFORM_MACOS
28 #error "MacOS is not supported!"
30 #error "Unknown Apple platform!"
35#elif defined(__ANDROID__)
36 #define HN_PLATFORM_ANDROID
37 #error "Android is not supported!"
38#elif defined(__linux__)
39 #define HN_PLATFORM_LINUX
40 #error "Linux is not supported!"
43 #error "Unknown platform!"
47 #define HN_ENABLE_ASSERTS
50#ifdef HN_ENABLE_ASSERTS
51 #define HN_ASSERT(x, ...) { if(!(x)) { HN_ERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } }
52 #define HN_CORE_ASSERT(x, ...) { if(!(x)) { HN_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); __debugbreak(); } }
54 #define HN_ASSERT(x, ...)
55 #define HN_CORE_ASSERT(x, ...)
58#define BIT(x) (1 << x)
60#define HN_BIND_EVENT_FN(fn) std::bind(&fn, this, std::placeholders::_1)
65 using Scope = std::unique_ptr<T>;
66 template<
typename T,
typename ... Args>
67 constexpr Scope <T> CreateScope(Args&& ... args)
69 return std::make_unique<T>(std::forward<Args>(args)...);
73 using Ref = std::shared_ptr<T>;
74 template<
typename T,
typename ... Args>
75 constexpr Ref<T> CreateRef(Args&& ... args)
77 return std::make_shared<T>(std::forward<Args>(args)...);