Initial late commit
This commit is contained in:
36
open_engine/include/open_engine/core.hpp
Normal file
36
open_engine/include/open_engine/core.hpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#ifndef CORE_HPP
|
||||
#define CORE_HPP
|
||||
|
||||
#include <memory>
|
||||
#ifdef __linux__
|
||||
#ifdef OE_EXPORT
|
||||
#define OE_API __attribute__((visibility("default")))
|
||||
#else
|
||||
#define OE_API
|
||||
#endif
|
||||
#elif defined(_WIN32) || defined(WIN32)
|
||||
#error Windows is not yet supported
|
||||
#endif
|
||||
|
||||
#ifdef OE_ENABLE_ASSERTS
|
||||
#include <signal.h>
|
||||
#define OE_ASSERT(x, ...) { if (!(x)) { OE_ERROR("Assertion Failed: {0}", __VA_ARGS__); raise(SIGTRAP); } }
|
||||
#define OE_CORE_ASSERT(x, ...) { if (!(x)) { OE_CORE_ERROR("Assertion Failed: {0}", __VA_ARGS__); raise(SIGTRAP); } }
|
||||
#else
|
||||
#define OE_ASSERT(x, ...)
|
||||
#define OE_CORE_ASSERT(x, ...)
|
||||
#endif
|
||||
|
||||
#define BIT(x) (1 << x)
|
||||
|
||||
#define BIND_EVENT_FN(function) std::bind(&function, this, std::placeholders::_1)
|
||||
|
||||
namespace OpenEngine {
|
||||
template<typename T>
|
||||
using Scope = std::unique_ptr<T>;
|
||||
|
||||
template<typename T>
|
||||
using Ref = std::shared_ptr<T>;
|
||||
}
|
||||
|
||||
#endif // CORE_HPP
|
||||
Reference in New Issue
Block a user