diff --git a/external/ege b/external/ege index c741f6e1..efca3ae4 160000 --- a/external/ege +++ b/external/ege @@ -1 +1 @@ -Subproject commit c741f6e1c8fe23e68a56937ecea08d6972fa3fd3 +Subproject commit efca3ae4bac53ed7565ca221274ba9c7c93611db diff --git a/external/ejson b/external/ejson index 3c102ab2..e7723856 160000 --- a/external/ejson +++ b/external/ejson @@ -1 +1 @@ -Subproject commit 3c102ab263a93b410c3e0cd118bb8d2bc67e0b28 +Subproject commit e7723856e4504b2a6e37554d8dc202c152487300 diff --git a/external/etk b/external/etk index 3ac971ec..4fb6bceb 160000 --- a/external/etk +++ b/external/etk @@ -1 +1 @@ -Subproject commit 3ac971ecb6c1a8d60593c1edc5db4368d3a601ca +Subproject commit 4fb6bcebac0309f27531bfe525f6d30a4c283642 diff --git a/sources/ewol/renderer/resources/Mesh.cpp b/sources/ewol/renderer/resources/Mesh.cpp index 43d43b78..72c07452 100644 --- a/sources/ewol/renderer/resources/Mesh.cpp +++ b/sources/ewol/renderer/resources/Mesh.cpp @@ -17,7 +17,9 @@ ewol::Mesh::Mesh(const etk::UString& _fileName, const etk::UString& _shaderName) : ewol::Resource(_fileName), m_normalMode(normalModeNone), - m_checkNormal(false) + m_checkNormal(false), + m_pointerShape(NULL), + m_functionFreeShape(NULL) { EWOL_DEBUG("Load a new mesh : '" << _fileName << "'"); // get the shader resource : @@ -68,6 +70,10 @@ ewol::Mesh::~Mesh(void) // remove dynamics dependencies : ewol::resource::Release(m_GLprogram); ewol::resource::Release(m_verticesVBO); + if (m_functionFreeShape!=NULL) { + m_functionFreeShape(m_pointerShape); + m_pointerShape = NULL; + } } //#define DISPLAY_NB_VERTEX_DISPLAYED @@ -994,3 +1000,14 @@ void ewol::Mesh::AddMaterial(const etk::UString& _name, ewol::Material* _data) // really add the material : m_materials.Add(_name, _data); } + + + +void ewol::Mesh::SetShape(void* _shape) +{ + if (m_functionFreeShape!=NULL) { + m_functionFreeShape(m_pointerShape); + m_pointerShape = NULL; + } + m_pointerShape=_shape; +}; diff --git a/sources/ewol/renderer/resources/Mesh.h b/sources/ewol/renderer/resources/Mesh.h index e0f88f2d..6b89dd7d 100644 --- a/sources/ewol/renderer/resources/Mesh.h +++ b/sources/ewol/renderer/resources/Mesh.h @@ -126,6 +126,23 @@ namespace ewol public: const etk::Vector& GetPhysicalProperties(void) const { return m_physics; }; + private: + void* m_pointerShape; //!< all mesh have a basic shape (bullet or other) the void pointer mermit to not depent on the bullet lib + public: + /** + * @brief Set the shape pointer (no type ==> user might know it ...) + * @param[in] _shape The new shape (this remove the previous one) + */ + void SetShape(void* _shape); + /** + * @brief Get the pointer on the shame (no type) + * @return Pointer on shape. + */ + void* GetShape(void) { return m_pointerShape; }; + private: + void (*m_functionFreeShape)(void* _pointer); + public: + void SetFreeShapeFunction(void (*_functionFreeShape)(void* _pointer)) { m_functionFreeShape = _functionFreeShape; }; }; };