diff --git a/CMake/Modules/FindMono.cmake b/CMake/Modules/FindMono.cmake index 70c8f48..1d68550 100644 --- a/CMake/Modules/FindMono.cmake +++ b/CMake/Modules/FindMono.cmake @@ -18,9 +18,9 @@ else() set(MONO_N "monosgen-2.0") endif() -set(MONO_LIBRARIES "${MONO_N}.lib") +find_library(MONO_LIBRARIES ${MONO_N} PATHS ${MONO_LIBRARY_DIR}) message("Mono Path: ${MONO_PATH}") -# message(${MONO_INCLUDE_DIR}) -# message(${MONO_LIBRARY_DIR}) -# message(${MONO_LIBRARIES}) \ No newline at end of file +#message(${MONO_INCLUDE_DIR}) +#message(${MONO_LIBRARY_DIR}) +#message(${MONO_LIBRARIES}) \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 7beaf5b..822fbf0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -165,7 +165,7 @@ list(APPEND OE_LIBRARIES FreeImage xsc_core assimp - ${MONO_LIBRARY_DIR}/${MONO_LIBRARIES} + ${MONO_LIBRARIES} ) list(APPEND OE_LIBRARIES_INC ${freetype_SOURCE_DIR}/include diff --git a/Code/include/OE/Engine/Component.hpp b/Code/include/OE/Engine/Component.hpp index 923264f..a6552ef 100644 --- a/Code/include/OE/Engine/Component.hpp +++ b/Code/include/OE/Engine/Component.hpp @@ -3,11 +3,15 @@ #include "OE/Config.hpp" +#include "OE/Meta/NativeReflection.hpp" + namespace OrbitEngine { namespace Engine { class Transform; class SceneObject; class Component { + NATIVE_REFLECTION + public: virtual ~Component(); diff --git a/Code/include/OE/Engine/MemoryDomain.hpp b/Code/include/OE/Engine/MemoryDomain.hpp index 907cd64..9334975 100644 --- a/Code/include/OE/Engine/MemoryDomain.hpp +++ b/Code/include/OE/Engine/MemoryDomain.hpp @@ -5,7 +5,7 @@ #include #include "OE/Meta/NativeType.hpp" -#include "OE/Memory/Allocator.hpp" +#include "OE/Memory/MemoryPool.hpp" namespace std { template <> @@ -26,11 +26,6 @@ namespace OrbitEngine { class WeakPtr; template class StrongPtr; - - namespace Memory { - template - class TrackedMemoryPool; - } } namespace OrbitEngine { namespace Engine { @@ -43,19 +38,23 @@ namespace OrbitEngine { namespace Engine { static MemoryDomain* Get(); template - StrongPtr Allocate(); + StrongPtr Create(); template - void Deallocate(Ptr& object); + void Destroy(Ptr& object); template const std::vector>& GetAll(); private: std::unordered_map m_Allocators; + std::unordered_map> */> m_Objects; + + template + std::vector>& GetObjects(); template - Memory::TrackedMemoryPool* GetAllocator(); + Memory::MemoryPool* GetAllocator(); template - Memory::TrackedMemoryPool* CreateAllocator(); + Memory::MemoryPool* CreateAllocator(); }; } } diff --git a/Code/include/OE/Engine/MemoryDomain.inl b/Code/include/OE/Engine/MemoryDomain.inl index 339804b..2d522e7 100644 --- a/Code/include/OE/Engine/MemoryDomain.inl +++ b/Code/include/OE/Engine/MemoryDomain.inl @@ -6,61 +6,98 @@ #include "OE/Memory/Ptrs.hpp" #include "OE/Memory/MemoryPool.hpp" +#include "OE/Misc/Log.hpp" + namespace OrbitEngine { namespace Engine { template - inline StrongPtr MemoryDomain::Allocate() + inline StrongPtr MemoryDomain::Create() { Meta::NativeType* type = Meta::NativeTypeResolver::Get(); - Memory::TrackedMemoryPool* allocator = GetAllocator(); + OE_ASSERT(type); + + Memory::MemoryPool* allocator = GetAllocator(); if (!allocator) allocator = CreateAllocator(); - StrongPtr object = allocator->AllocatePtr(); - if (object) - type->Construct(object.Get()); - return object; + void* obj = allocator->Allocate(); + if (obj == 0) + return StrongPtr(); + type->Construct(obj); + + std::vector>& objs = GetObjects(); + + StrongPtr ptr = StrongPtr(static_cast(obj)); + + /* -- */ + auto it = std::lower_bound(objs.begin(), objs.end(), WeakPtr(ptr), [](const WeakPtr& lhs, const WeakPtr& rhs) { + return lhs.Get() < rhs.Get(); + }); + objs.insert(it, ptr); + /* -- */ + + return ptr; } template - inline void MemoryDomain::Deallocate(Ptr& object) + inline void MemoryDomain::Destroy(Ptr& object) { Meta::NativeType* type = Meta::NativeTypeResolver::Get(); - Memory::TrackedMemoryPool* allocator = GetAllocator(); - OE_ASSERT(allocator) + OE_ASSERT(type); + Memory::MemoryPool* allocator = GetAllocator(); + OE_ASSERT(allocator); type->Destruct(object.Get()); - allocator->DeallocatePtr(object); + allocator->Deallocate(object.Get()); + + std::vector>& objs = GetObjects(); + + /* -- */ + auto it = std::lower_bound(objs.begin(), objs.end(), WeakPtr(object), [](const WeakPtr& lhs, const WeakPtr& rhs) { + return lhs.Get() < rhs.Get(); + }); + objs.erase(it); + /* -- */ } template inline const std::vector>& MemoryDomain::GetAll() { - return GetAllocator()->GetAll(); + return GetObjects(); } template - inline Memory::TrackedMemoryPool* MemoryDomain::GetAllocator() + inline Memory::MemoryPool* MemoryDomain::GetAllocator() { - Meta::NativeType* type = Meta::NativeTypeResolver::Get(); - OE_ASSERT(type) - auto it = m_Allocators.find(type); + auto it = m_Allocators.find(Meta::NativeTypeResolver::Get()); if (it != m_Allocators.end()) - return static_cast*>((*it).second); + return static_cast((*it).second); return nullptr; } template - inline Memory::TrackedMemoryPool* MemoryDomain::CreateAllocator() + inline Memory::MemoryPool* MemoryDomain::CreateAllocator() { - Meta::NativeType* type = Meta::NativeTypeResolver::Get(); - OE_ASSERT(type) - Memory::TrackedMemoryPool* allocator = new Memory::TrackedMemoryPool(100); + const int capacity = 100; - m_Allocators.insert(std::make_pair(type, allocator)); + Memory::MemoryPool* allocator = new Memory::MemoryPool(sizeof(T), capacity); + + m_Allocators.insert(std::make_pair(Meta::NativeTypeResolver::Get(), allocator)); + GetObjects().reserve(capacity); return allocator; } + + template + inline std::vector>& MemoryDomain::GetObjects() + { + Meta::NativeType* type = Meta::NativeTypeResolver::Get(); + OE_ASSERT(type); + auto it = m_Objects.find(type); + if (it == m_Objects.end()) + m_Objects[type] = new std::vector>(); + return *static_cast>*>(m_Objects[type]); + } } } #endif \ No newline at end of file diff --git a/Code/include/OE/Engine/SceneObject.hpp b/Code/include/OE/Engine/SceneObject.hpp index c2355ac..610ffe2 100644 --- a/Code/include/OE/Engine/SceneObject.hpp +++ b/Code/include/OE/Engine/SceneObject.hpp @@ -10,6 +10,7 @@ #include "OE/Config.hpp" #include "OE/Misc/Log.hpp" +#include "OE/Memory/Ptrs.hpp" #include "OE/Engine/Object.hpp" #include "OE/Engine/Scene.hpp" #include "OE/Engine/Component.hpp" @@ -33,6 +34,9 @@ namespace OrbitEngine { namespace Engine { void SetName(const std::string& name); void SetParent(WeakPtr parent, int position = 99999999); + template + WeakPtr AddComponent(); + private: friend class Scene; @@ -42,7 +46,16 @@ namespace OrbitEngine { namespace Engine { std::string m_Name; std::vector> m_Childs; + std::vector> m_Components; }; + + template + inline WeakPtr SceneObject::AddComponent() + { + StrongPtr ptr = MemoryDomain::Get()->Create(); + m_Components.push_back(ptr.template AsStrong()); + return ptr; + } } } #endif \ No newline at end of file diff --git a/Code/include/OE/Engine/TestComponent.hpp b/Code/include/OE/Engine/TestComponent.hpp index 4ffc69c..2cf6bc1 100644 --- a/Code/include/OE/Engine/TestComponent.hpp +++ b/Code/include/OE/Engine/TestComponent.hpp @@ -8,11 +8,15 @@ #include "OE/Math/Vec3.hpp" #include "OE/Math/Vec4.hpp" +#include "OE/Meta/NativeReflection.hpp" + #include "Transform.hpp" namespace OrbitEngine { namespace Engine { class TestComponent : public Component { + NATIVE_REFLECTION + public: TestComponent(); ~TestComponent(); diff --git a/Code/include/OE/Engine/Transform.hpp b/Code/include/OE/Engine/Transform.hpp index dc9ff6e..34a06b4 100644 --- a/Code/include/OE/Engine/Transform.hpp +++ b/Code/include/OE/Engine/Transform.hpp @@ -10,6 +10,8 @@ namespace OrbitEngine { namespace Engine { class Transform : public Component { + NATIVE_REFLECTION + public: Transform(); ~Transform(); diff --git a/Code/include/OE/Memory/MemoryPool.hpp b/Code/include/OE/Memory/MemoryPool.hpp index 65e9eea..279787f 100644 --- a/Code/include/OE/Memory/MemoryPool.hpp +++ b/Code/include/OE/Memory/MemoryPool.hpp @@ -4,7 +4,6 @@ #include #include "OE/Memory/Allocator.hpp" -#include "OE/Memory/Ptrs.hpp" namespace OrbitEngine { namespace Memory { class MemoryPool : public Allocator { @@ -23,23 +22,6 @@ namespace OrbitEngine { namespace Memory { unsigned char* m_Memory; unsigned char* m_Next; }; - - template - class TrackedMemoryPool : public MemoryPool { - public: - TrackedMemoryPool(int capacity); - virtual ~TrackedMemoryPool(); - - StrongPtr AllocatePtr(); - void DeallocatePtr(Ptr& ptr); - - const std::vector>& GetAll() const; - - private: - std::vector> m_Used; - }; } } -#include "OE/Memory/MemoryPool.inl" - #endif \ No newline at end of file diff --git a/Code/include/OE/Memory/MemoryPool.inl b/Code/include/OE/Memory/MemoryPool.inl deleted file mode 100644 index 4f162e6..0000000 --- a/Code/include/OE/Memory/MemoryPool.inl +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef MEMORY_MEMORY_POOL_INL -#define MEMORY_MEMORY_POOL_INL - -#include "OE/Memory/MemoryPool.hpp" - -namespace OrbitEngine { namespace Memory { - - template - inline TrackedMemoryPool::TrackedMemoryPool(int capacity) - : MemoryPool(sizeof(T), capacity) - { - m_Used.reserve(capacity); - } - - template - inline TrackedMemoryPool::~TrackedMemoryPool() - { - m_Used.clear(); - } - - template - inline StrongPtr TrackedMemoryPool::AllocatePtr() - { - void* obj = MemoryPool::Allocate(); - if (obj == 0) - return StrongPtr(); - - StrongPtr ptr = StrongPtr(static_cast(obj)); - - auto it = std::lower_bound(m_Used.begin(), m_Used.end(), WeakPtr(ptr), [](const WeakPtr& lhs, const WeakPtr& rhs) { - return lhs.Get() < rhs.Get(); - }); - - m_Used.insert(it, ptr); - - return ptr; - } - - template - inline void TrackedMemoryPool::DeallocatePtr(Ptr& ptr) - { - MemoryPool::Deallocate(ptr.Get()); - - auto it = std::lower_bound(m_Used.begin(), m_Used.end(), WeakPtr(ptr), [](const WeakPtr& lhs, const WeakPtr& rhs) { - return lhs.Get() < rhs.Get(); - }); - m_Used.erase(it); - } - - template - inline const std::vector>& TrackedMemoryPool::GetAll() const - { - return m_Used; - } -} } - -#endif \ No newline at end of file diff --git a/Code/include/OE/Memory/Ptrs.hpp b/Code/include/OE/Memory/Ptrs.hpp index dcadc2c..29b98fa 100644 --- a/Code/include/OE/Memory/Ptrs.hpp +++ b/Code/include/OE/Memory/Ptrs.hpp @@ -1,12 +1,9 @@ #ifndef PTRS_HPP #define PTRS_HPP -#include "OE/Meta/NativeReflection.hpp" -#include "OE/Misc/Log.hpp" - namespace OrbitEngine { - namespace Engine { - class MemoryDomain; + namespace Meta { + class NativeType; } template @@ -14,25 +11,24 @@ namespace OrbitEngine { template class WeakPtr; - namespace internal { - struct RefCount { - // TODO atomic - unsigned int strong = 0; - unsigned int weak = 0; + struct RefCount { + // TODO atomic + unsigned int strong = 0; + unsigned int weak = 0; - void Decr(); - void Incr(); - void WDecr(); - void WIncr(); + void Decr(); + void Incr(); + void WDecr(); + void WIncr(); - void Destroy(); - }; - } + void Destroy(); + }; template class Ptr { public: - Ptr(T* ptr = 0); + + Ptr(T* ptr = 0, RefCount* ref_count = 0); virtual ~Ptr(); Meta::NativeType* GetType() const; @@ -42,52 +38,60 @@ namespace OrbitEngine { T& operator*() const; T* operator->() const; operator bool() const; - bool operator==(const Ptr& rhs) const; bool operator!=(const Ptr& rhs) const; + template + WeakPtr AsWeak(); + template + StrongPtr AsStrong(); + protected: - internal::RefCount* m_RefCount; + RefCount* m_RefCount; T* m_Ptr; + virtual void BuildFromPtr(const Ptr& ptr); + friend class StrongPtr; friend class WeakPtr; }; - + template class StrongPtr : public Ptr { public: StrongPtr(T* ptr = 0); - StrongPtr(StrongPtr&& mv); + StrongPtr(const Ptr& ptr); StrongPtr(const StrongPtr& ptr); StrongPtr(const WeakPtr& ptr); + StrongPtr(StrongPtr&& mv); ~StrongPtr(); StrongPtr& operator=(const StrongPtr& ptr); StrongPtr& operator=(const WeakPtr& ptr); - StrongPtr& operator=(StrongPtr&& other); void Clear() override; - private: - void BuildFromPtr(const Ptr& ptr); + void BuildFromPtr(const Ptr& ptr) override; }; template class WeakPtr : public Ptr { public: + WeakPtr(); WeakPtr(const Ptr& ptr); WeakPtr(const StrongPtr& ptr); WeakPtr(const WeakPtr& ptr); - WeakPtr(); + WeakPtr(WeakPtr&& mv); ~WeakPtr(); WeakPtr& operator=(const StrongPtr& ptr); WeakPtr& operator=(const WeakPtr& ptr); + WeakPtr& operator=(WeakPtr&& other); + + void Clear() override; - private: - void BuildFromPtr(const Ptr& ptr); + void BuildFromPtr(const Ptr& ptr) override; }; } diff --git a/Code/include/OE/Memory/Ptrs.inl b/Code/include/OE/Memory/Ptrs.inl index 2b06ff9..6878e40 100644 --- a/Code/include/OE/Memory/Ptrs.inl +++ b/Code/include/OE/Memory/Ptrs.inl @@ -3,47 +3,46 @@ #include "OE/Memory/Ptrs.hpp" +#include "OE/Meta/NativeReflection.hpp" #include "OE/Engine/MemoryDomain.hpp" +#include "OE/Misc/Log.hpp" namespace OrbitEngine { - namespace internal { - inline void RefCount::Decr() - { - strong--; - if (strong + weak == 0) Destroy(); - } + inline void RefCount::Decr() + { + strong--; + if (strong + weak == 0) Destroy(); + } - inline void RefCount::Incr() - { - strong++; - } + inline void RefCount::Incr() + { + strong++; + } - inline void RefCount::WDecr() - { - weak--; - if (strong + weak == 0) Destroy(); - } + inline void RefCount::WDecr() + { + weak--; + if (strong + weak == 0) Destroy(); + } - inline void RefCount::WIncr() - { - weak++; - } + inline void RefCount::WIncr() + { + weak++; + } - inline void RefCount::Destroy() - { - delete this; - } + inline void RefCount::Destroy() + { + delete this; } - // Ptr template - inline Ptr::Ptr(T* ptr) - : m_Ptr(ptr), m_RefCount(0) + inline Ptr::Ptr(T* ptr, RefCount* ref_count) + : m_Ptr(ptr), m_RefCount(ref_count) { } - + template inline Ptr::~Ptr() { @@ -62,6 +61,15 @@ namespace OrbitEngine { m_Ptr = 0; } + template + inline void Ptr::BuildFromPtr(const Ptr& ptr) + { + Clear(); + + m_Ptr = ptr.m_Ptr; + m_RefCount = ptr.m_RefCount; + } + template inline T* Ptr::Get() const { @@ -100,22 +108,36 @@ namespace OrbitEngine { return !operator==(rhs); } - // Strong + template + template + inline WeakPtr Ptr::AsWeak() + { + return WeakPtr(Ptr(static_cast(m_Ptr), m_RefCount)); + } + + template + template + inline StrongPtr Ptr::AsStrong() + { + return StrongPtr(Ptr(static_cast(m_Ptr), m_RefCount)); + } + template inline StrongPtr::StrongPtr(T* ptr) : Ptr(ptr) { - if (ptr) { - this->m_RefCount = new internal::RefCount(); + if (this->m_Ptr) { + if (!this->m_RefCount) + this->m_RefCount = new RefCount(); this->m_RefCount->Incr(); } } template - inline StrongPtr::StrongPtr(StrongPtr&& mv) + inline StrongPtr::StrongPtr(const Ptr& ptr) { - operator=(mv); + BuildFromPtr(ptr); } template @@ -127,6 +149,13 @@ namespace OrbitEngine { template inline StrongPtr::StrongPtr(const WeakPtr& ptr) { + BuildFromPtr(ptr); + } + + template + inline StrongPtr::StrongPtr(StrongPtr&& mv) + { + operator=(mv); } template @@ -155,11 +184,7 @@ namespace OrbitEngine { if (this == &other) return *this; - Clear(); - - this->m_Ptr = other.m_Ptr; - this->m_RefCount = other.m_RefCount; - + Ptr::BuildFromPtr(other); other.Ptr::Clear(); return *this; @@ -172,7 +197,7 @@ namespace OrbitEngine { if (this->m_RefCount->strong == 1) { Engine::MemoryDomain* md = Engine::MemoryDomain::Get(); if (md) - md->Deallocate(*this); + md->Destroy(*this); else delete this->m_Ptr; } @@ -184,16 +209,18 @@ namespace OrbitEngine { template inline void StrongPtr::BuildFromPtr(const Ptr& ptr) { - Clear(); - - this->m_Ptr = ptr.m_Ptr; - this->m_RefCount = ptr.m_RefCount; + Ptr::BuildFromPtr(ptr); if (this->m_RefCount && this->m_RefCount->strong > 0) this->m_RefCount->Incr(); } - // Weak + + template + inline WeakPtr::WeakPtr() + : Ptr() + { + } template inline WeakPtr::WeakPtr(const Ptr& ptr) @@ -214,17 +241,15 @@ namespace OrbitEngine { } template - inline WeakPtr::WeakPtr() - : Ptr() + inline WeakPtr::WeakPtr(WeakPtr&& mv) { + operator=(mv); } template inline WeakPtr::~WeakPtr() { - if (this->m_RefCount) { - this->m_RefCount->WDecr(); - } + Clear(); } template @@ -242,13 +267,29 @@ namespace OrbitEngine { } template - inline void WeakPtr::BuildFromPtr(const Ptr& ptr) + inline WeakPtr& WeakPtr::operator=(WeakPtr&& other) + { + if (this == &other) + return *this; + + Ptr::BuildFromPtr(other); + other.Ptr::Clear(); + + return *this; + } + + template + inline void WeakPtr::Clear() { if (this->m_RefCount) this->m_RefCount->WDecr(); + Ptr::Clear(); + } - this->m_Ptr = ptr.m_Ptr; - this->m_RefCount = ptr.m_RefCount; + template + inline void WeakPtr::BuildFromPtr(const Ptr& ptr) + { + Ptr::BuildFromPtr(ptr); if (this->m_RefCount) this->m_RefCount->WIncr(); diff --git a/Code/include/OE/Meta/NativeReflection.hpp b/Code/include/OE/Meta/NativeReflection.hpp index 1889f7e..3ec8340 100644 --- a/Code/include/OE/Meta/NativeReflection.hpp +++ b/Code/include/OE/Meta/NativeReflection.hpp @@ -48,15 +48,17 @@ namespace OrbitEngine { namespace Meta { static Meta::NativeType Reflection; \ private: \ static void meta_reflect(Meta::NativeType*); \ + static void meta_ctor(void* ptr); \ + static void meta_dctor(void* ptr); \ #define NATIVE_REFLECTION_BEGIN(type) \ - static void meta_ctor_##type (void* ptr) { new (ptr) type (); } \ - static void meta_dctor_##type (void* ptr) { static_cast(ptr)-> type ::~type (); } \ + void type::meta_ctor (void* ptr) { new (ptr) type (); } \ + void type::meta_dctor (void* ptr) { static_cast(ptr)-> type ::~type (); } \ Meta::NativeType type::Reflection{type::meta_reflect}; \ void type::meta_reflect(Meta::NativeType* t) { \ using T = type; \ t->SetKind(Meta::Kind::CLASS); \ - t->SetCtorAndDctor(meta_ctor_##type, meta_dctor_##type); \ + t->SetCtorAndDctor(meta_ctor, meta_dctor); \ t->SetName(#type); \ t->SetSize(sizeof(T)); \ diff --git a/Code/include/OE/Platform/OpenGL/OpenGL.hpp b/Code/include/OE/Platform/OpenGL/OpenGL.hpp index f20204b..5e830c3 100644 --- a/Code/include/OE/Platform/OpenGL/OpenGL.hpp +++ b/Code/include/OE/Platform/OpenGL/OpenGL.hpp @@ -50,6 +50,7 @@ #if OE_WINDOWS #include "OE/Platform/Windows/Windows.hpp" #elif OE_LINUX + #include "OE/Platform/X11/X11.hpp" #include #endif #include diff --git a/Code/src/OE/Engine/Component.cpp b/Code/src/OE/Engine/Component.cpp index f0df6df..91f5717 100644 --- a/Code/src/OE/Engine/Component.cpp +++ b/Code/src/OE/Engine/Component.cpp @@ -30,4 +30,8 @@ namespace OrbitEngine { namespace Engine { { } + + NATIVE_REFLECTION_BEGIN(Component) + + NATIVE_REFLECTION_END() } } \ No newline at end of file diff --git a/Code/src/OE/Engine/Scene.cpp b/Code/src/OE/Engine/Scene.cpp index 2a5ddc1..60f629a 100644 --- a/Code/src/OE/Engine/Scene.cpp +++ b/Code/src/OE/Engine/Scene.cpp @@ -9,7 +9,7 @@ namespace OrbitEngine { namespace Engine { Scene::Scene() { - m_Root = MemoryDomain::Get()->Allocate(); + m_Root = MemoryDomain::Get()->Create(); m_Root->m_Self = m_Root; //m_Root->m_Scene = WeakPtr(this); m_Root->SetName("Root"); diff --git a/Code/src/OE/Engine/SceneObject.cpp b/Code/src/OE/Engine/SceneObject.cpp index 00214a1..4bef152 100644 --- a/Code/src/OE/Engine/SceneObject.cpp +++ b/Code/src/OE/Engine/SceneObject.cpp @@ -10,11 +10,14 @@ namespace OrbitEngine { namespace Engine { SceneObject::SceneObject() : m_Name("SceneObject") { + AddComponent(); + AddComponent(); } SceneObject::~SceneObject() { m_Childs.clear(); + m_Components.clear(); } WeakPtr SceneObject::GetScene() const @@ -46,7 +49,7 @@ namespace OrbitEngine { namespace Engine { WeakPtr SceneObject::AddChildren() { - StrongPtr sceneObject = MemoryDomain::Get()->Allocate(); + StrongPtr sceneObject = MemoryDomain::Get()->Create(); if (!sceneObject) { OE_LOG_WARNING("Can't allocate more SceneObjects!"); return WeakPtr(); diff --git a/Code/src/OE/Engine/TestComponent.cpp b/Code/src/OE/Engine/TestComponent.cpp index 58779f5..d4db85c 100644 --- a/Code/src/OE/Engine/TestComponent.cpp +++ b/Code/src/OE/Engine/TestComponent.cpp @@ -11,4 +11,8 @@ namespace OrbitEngine { namespace Engine { { } + + NATIVE_REFLECTION_BEGIN(TestComponent) + NATIVE_REFLECTION_MEMBER(m_Int) + NATIVE_REFLECTION_END() } } \ No newline at end of file diff --git a/Code/src/OE/Engine/Transform.cpp b/Code/src/OE/Engine/Transform.cpp index b10a143..eef4e62 100644 --- a/Code/src/OE/Engine/Transform.cpp +++ b/Code/src/OE/Engine/Transform.cpp @@ -47,4 +47,7 @@ namespace OrbitEngine { namespace Engine { return m_Matrix; } + + NATIVE_REFLECTION_BEGIN(Transform) + NATIVE_REFLECTION_END() } } \ No newline at end of file