From 90bb34913804c17bd3c88cf636492d5d15c2ecdc Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Thu, 14 Mar 2013 21:50:17 +0100 Subject: [PATCH] [DEV] better mesh display using indec istead of direct drawing all point --- sources/ewol/compositing/Compositing.cpp | 2 +- sources/ewol/compositing/Compositing.h | 2 +- sources/ewol/compositing/Text.cpp | 41 ++++ sources/ewol/compositing/Text.h | 1 + sources/ewol/renderer/openGL.cpp | 17 +- sources/ewol/renderer/openGL.h | 5 +- sources/ewol/renderer/resources/Mesh.cpp | 217 +++++++++++------- sources/ewol/renderer/resources/Mesh.h | 8 + .../resources/VirtualBufferObject.cpp | 66 +++--- .../renderer/resources/VirtualBufferObject.h | 22 +- 10 files changed, 255 insertions(+), 126 deletions(-) diff --git a/sources/ewol/compositing/Compositing.cpp b/sources/ewol/compositing/Compositing.cpp index 607cd0d6..a11533ca 100644 --- a/sources/ewol/compositing/Compositing.cpp +++ b/sources/ewol/compositing/Compositing.cpp @@ -55,7 +55,7 @@ void ewol::Compositing::Clear(void) } -void ewol::Compositing::SetMatrix(mat4 mat) +void ewol::Compositing::SetMatrix(const mat4& mat) { m_matrixApply = mat; } diff --git a/sources/ewol/compositing/Compositing.h b/sources/ewol/compositing/Compositing.h index 82ada712..3479e9f6 100644 --- a/sources/ewol/compositing/Compositing.h +++ b/sources/ewol/compositing/Compositing.h @@ -59,7 +59,7 @@ namespace ewol * @brief set the transformation matrix * @param[in] mat The new matrix. */ - virtual void SetMatrix(mat4 mat); + virtual void SetMatrix(const mat4& mat); }; }; diff --git a/sources/ewol/compositing/Text.cpp b/sources/ewol/compositing/Text.cpp index 880a5645..e09b4f18 100644 --- a/sources/ewol/compositing/Text.cpp +++ b/sources/ewol/compositing/Text.cpp @@ -98,6 +98,47 @@ void ewol::Text::LoadProgram(void) } } +void ewol::Text::Draw(const mat4& transformationMatrix) +{ + + // draw BG in any case: + m_vectorialDraw.Draw(); + + if (m_coord.Size()<=0 || NULL == m_font) { + // TODO : a remÚtre ... + //EWOL_WARNING("Nothink to draw..."); + return; + } + if (m_font == NULL) { + EWOL_WARNING("no font..."); + return; + } + if (m_GLprogram==NULL) { + EWOL_ERROR("No shader ..."); + return; + } + ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST); + // set Matrix : translation/positionMatrix + mat4 projMatrix = ewol::openGL::GetMatrix(); + mat4 camMatrix = ewol::openGL::GetCameraMatrix(); + mat4 tmpMatrix = projMatrix * camMatrix * transformationMatrix; + m_GLprogram->Use(); + m_GLprogram->UniformMatrix4fv(m_GLMatrix, 1, tmpMatrix.m_mat); + // TextureID + m_GLprogram->SetTexture0(m_GLtexID, m_font->GetId()); + // position : + m_GLprogram->SendAttribute(m_GLPosition, 2/*x,y*/, &m_coord[0]); + // Texture : + m_GLprogram->SendAttribute(m_GLtexture, 2/*u,v*/, &m_coordTex[0]); + // color : + m_GLprogram->SendAttribute(m_GLColor, 4/*r,g,b,a*/, &m_coordColor[0]); + // Request the draw od the elements : + ewol::openGL::DrawArrays(GL_TRIANGLES, 0, m_coord.Size()); + m_GLprogram->UnUse(); + ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST); +} + + void ewol::Text::Draw(void) { // draw BG in any case: diff --git a/sources/ewol/compositing/Text.h b/sources/ewol/compositing/Text.h index 4ace36f9..deaa7a3a 100644 --- a/sources/ewol/compositing/Text.h +++ b/sources/ewol/compositing/Text.h @@ -119,6 +119,7 @@ namespace ewol * @brief Draw All the refistered text in the current element on openGL */ void Draw(void); + void Draw(const mat4& transformationMatrix); /** * @brief Clear all the registered element in the current element */ diff --git a/sources/ewol/renderer/openGL.cpp b/sources/ewol/renderer/openGL.cpp index 29f1f211..fbd7b4a6 100644 --- a/sources/ewol/renderer/openGL.cpp +++ b/sources/ewol/renderer/openGL.cpp @@ -250,10 +250,23 @@ void ewol::openGL::DrawArrays(uint32_t mode, int32_t first, int32_t count) glDrawArrays(mode, first, count); } -void ewol::openGL::DrawElements(uint32_t mode, int32_t count, uint32_t type, const void* indices) +void ewol::openGL::DrawElements(uint32_t mode, const etk::Vector& indices) { UpdateAllFlags(); - glDrawElements(mode, count, type, indices); + //EWOL_DEBUG("Request draw of " << indices.Size() << "elements"); + glDrawElements(mode, indices.Size(), GL_UNSIGNED_INT, &indices[0]); +} + +void ewol::openGL::DrawElements16(uint32_t mode, const etk::Vector& indices) +{ + UpdateAllFlags(); + glDrawElements(mode, indices.Size(), GL_UNSIGNED_SHORT, &indices[0]); +} + +void ewol::openGL::DrawElements8(uint32_t mode, const etk::Vector& indices) +{ + UpdateAllFlags(); + glDrawElements(mode, indices.Size(), GL_UNSIGNED_BYTE, &indices[0]); } diff --git a/sources/ewol/renderer/openGL.h b/sources/ewol/renderer/openGL.h index e092efff..8affd749 100644 --- a/sources/ewol/renderer/openGL.h +++ b/sources/ewol/renderer/openGL.h @@ -10,6 +10,7 @@ #define __OPEN_GL_H__ #include +#include #include #ifdef __cplusplus @@ -166,7 +167,9 @@ namespace ewol { * @brief draw a specific array ==> this enable mode difference ... */ void DrawArrays(uint32_t mode, int32_t first, int32_t count); - void DrawElements(uint32_t mode, int32_t count, uint32_t type, const void* indices); + void DrawElements (uint32_t mode, const etk::Vector& indices); + void DrawElements16(uint32_t mode, const etk::Vector& indices); + void DrawElements8 (uint32_t mode, const etk::Vector& indices); /** * @brief Use openGL program * @param[in] id Id of the program that might be used diff --git a/sources/ewol/renderer/resources/Mesh.cpp b/sources/ewol/renderer/resources/Mesh.cpp index 9f9d1037..f35be53c 100644 --- a/sources/ewol/renderer/resources/Mesh.cpp +++ b/sources/ewol/renderer/resources/Mesh.cpp @@ -110,9 +110,15 @@ ewol::Mesh::~Mesh(void) void ewol::Mesh::Draw(mat4& positionMatrix) { - if (m_numberOfElments<=0) { - return; - } + #ifndef USE_INDEXED_MESH + if (m_numberOfElments<=0) { + return; + } + #else + if (m_listIndexFaces.Size()<=0) { + return; + } + #endif if (NULL == m_texture0) { EWOL_WARNING("Texture does not exist ..."); return; @@ -139,13 +145,19 @@ void ewol::Mesh::Draw(mat4& positionMatrix) // position : m_GLprogram->SendAttributePointer(m_GLNormal, 3/*x,y,z*/, m_verticesVBO, MESH_VBO_VERTICES_NORMAL); // position : - m_GLprogram->SendAttributePointer(m_GLNormalFace, 3/*x,y,z*/, m_verticesVBO, MESH_VBO_FACE_NORMAL); + #ifndef USE_INDEXED_MESH + m_GLprogram->SendAttributePointer(m_GLNormalFace, 3/*x,y,z*/, m_verticesVBO, MESH_VBO_FACE_NORMAL); + #endif // draw materials : m_material.Draw(m_GLprogram); m_light.Draw(m_GLprogram); - // Request the draw od the elements : - ewol::openGL::DrawArrays(GL_TRIANGLES, 0, m_numberOfElments); + #ifndef USE_INDEXED_MESH + // Request the draw od the elements : + ewol::openGL::DrawArrays(GL_TRIANGLES, 0, m_numberOfElments); + #else + ewol::openGL::DrawElements(GL_TRIANGLES, m_listIndexFaces); + #endif m_GLprogram->UnUse(); ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST); // TODO : UNDERSTAND why ... it is needed @@ -205,83 +217,128 @@ void ewol::Mesh::GenerateVBO(void) // calculate the normal of all faces if needed CalculateNormaleFace(); CalculateNormaleEdge(); - // TODO : Set a better display system, this one is the worst I known ... - for (int32_t iii=0; iiiPushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); - m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); - if(true==m_enableVertexNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); - } - if(true==m_enableFaceNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); - } - - indice = 1; - tmpUV = m_listUV[m_listFaces[iii].m_uv[indice]]; - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); - m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); - if(true==m_enableVertexNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); - } - if(true==m_enableFaceNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); - } - - indice = 2; - tmpUV = m_listUV[m_listFaces[iii].m_uv[indice]]; - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); - m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); - if(true==m_enableVertexNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); - } - if(true==m_enableFaceNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); - } - #ifndef PRINT_HALF - if (m_listFaces[iii].m_nbElement==4) { - indice = 0; - tmpUV = m_listUV[m_listFaces[iii].m_uv[indice]]; - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); - m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); - if(true==m_enableVertexNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); + #ifdef USE_INDEXED_MESH + // remove old elements + m_listIndexFaces.Clear(); + // Generate element in 2 pass : + // - create new index dependeng a vertex is a unique componenet of position, texture, normal + // - the index list generation (can be dynamic ... (TODO later) + for (int32_t iii=0; iiiSizeOnBufferVec3(MESH_VBO_VERTICES); jjj++) { + if( m_verticesVBO->GetOnBufferVec3(MESH_VBO_VERTICES,jjj) == position + && m_verticesVBO->GetOnBufferVec3(MESH_VBO_VERTICES_NORMAL,jjj) == normal + && m_verticesVBO->GetOnBufferVec2(MESH_VBO_TEXTURE,jjj) == texturepos) { + m_listFaces[iii].m_vertexVBOId[indice] = jjj; + elementFind = true; + // stop searching ... + break; + } } - if(true==m_enableFaceNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); - } - - indice = 2; - tmpUV = m_listUV[m_listFaces[iii].m_uv[indice]]; - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); - m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); - if(true==m_enableVertexNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); - } - if(true==m_enableFaceNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); - } - - indice = 3; - tmpUV = m_listUV[m_listFaces[iii].m_uv[indice]]; - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); - m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); - if(true==m_enableVertexNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); - } - if(true==m_enableFaceNormal) { - m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); + if (false == elementFind) { + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES, position); + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL, normal); + m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, texturepos); + m_listFaces[iii].m_vertexVBOId[indice] = m_verticesVBO->SizeOnBufferVec3(MESH_VBO_VERTICES)-1; } } - #endif - } + } + for (int32_t iii=0; iiiPushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); + m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); + if(true==m_enableVertexNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); + } + if(true==m_enableFaceNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); + } + + indice = 1; + tmpUV = m_listUV[m_listFaces[iii].m_uv[indice]]; + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); + m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); + if(true==m_enableVertexNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); + } + if(true==m_enableFaceNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); + } + + indice = 2; + tmpUV = m_listUV[m_listFaces[iii].m_uv[indice]]; + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); + m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); + if(true==m_enableVertexNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); + } + if(true==m_enableFaceNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); + } + #ifndef PRINT_HALF + if (m_listFaces[iii].m_nbElement==4) { + indice = 0; + tmpUV = m_listUV[m_listFaces[iii].m_uv[indice]]; + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); + m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); + if(true==m_enableVertexNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); + } + if(true==m_enableFaceNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); + } + + indice = 2; + tmpUV = m_listUV[m_listFaces[iii].m_uv[indice]]; + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); + m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); + if(true==m_enableVertexNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); + } + if(true==m_enableFaceNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); + } + + indice = 3; + tmpUV = m_listUV[m_listFaces[iii].m_uv[indice]]; + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES,m_listVertex[m_listFaces[iii].m_vertex[indice]]); + m_verticesVBO->PushOnBuffer(MESH_VBO_TEXTURE, vec2(tmpUV.x(),1.0f-tmpUV.y())); + if(true==m_enableVertexNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_VERTICES_NORMAL,m_listVertexNormal[m_listFaces[iii].m_vertex[indice]]); + } + if(true==m_enableFaceNormal) { + m_verticesVBO->PushOnBuffer(MESH_VBO_FACE_NORMAL,m_listFacesNormal[iii]); + } + } + #endif + } + #endif // update all the VBO elements ... m_verticesVBO->Flush(); } diff --git a/sources/ewol/renderer/resources/Mesh.h b/sources/ewol/renderer/resources/Mesh.h index 4f619e22..2d61a3c2 100644 --- a/sources/ewol/renderer/resources/Mesh.h +++ b/sources/ewol/renderer/resources/Mesh.h @@ -23,10 +23,12 @@ #define MESH_VBO_TEXTURE (1) // 3 "float" elements #define MESH_VBO_VERTICES_NORMAL (2) +// Face normal position : #define MESH_VBO_FACE_NORMAL (3) // 4 "float" elements #define MESH_VBO_COLOR (4) +#define USE_INDEXED_MESH namespace ewol { class DisplacementTable @@ -104,6 +106,9 @@ namespace ewol int32_t m_nbElement; int32_t m_vertex[4]; int32_t m_uv[4]; + #ifdef USE_INDEXED_MESH + int32_t m_vertexVBOId[4]; // used to be an entry point of the rework of the dynamic generating of mesh + #endif public: Face(void) {}; Face(int32_t v1, int32_t t1, @@ -158,6 +163,9 @@ namespace ewol etk::Vector m_listFaces; //!< List of all Face for the mesh etk::Vector m_listFacesNormal; //!< List of all Face normal, when calculated etk::Vector m_listVertexNormal; //!< List of all Face normal, when calculated + #ifdef USE_INDEXED_MESH + etk::Vector m_listIndexFaces; + #endif protected: ewol::VirtualBufferObject* m_verticesVBO; ewol::TextureFile* m_texture0; diff --git a/sources/ewol/renderer/resources/VirtualBufferObject.cpp b/sources/ewol/renderer/resources/VirtualBufferObject.cpp index b2d9ebc5..835d7096 100644 --- a/sources/ewol/renderer/resources/VirtualBufferObject.cpp +++ b/sources/ewol/renderer/resources/VirtualBufferObject.cpp @@ -11,13 +11,13 @@ #include #include -ewol::VirtualBufferObject::VirtualBufferObject(const etk::UString& accesMode, int32_t nbElement): +ewol::VirtualBufferObject::VirtualBufferObject(const etk::UString& accesMode): ewol::Resource(), - m_exist(false), - m_nbVBO(nbElement) + m_exist(false) { for (int32_t iii=0; iiim_buffer[id].Size()) { + return vec3(0,0,0); + } + return vec3(m_buffer[id][3*elementID], + m_buffer[id][3*elementID+1], + m_buffer[id][3*elementID+2]); +} +int32_t ewol::VirtualBufferObject::SizeOnBufferVec3(int32_t id) +{ + return m_buffer[id].Size()/3; } void ewol::VirtualBufferObject::PushOnBuffer(int32_t id, const vec2& data) { + m_vboUsed[id] = true; m_buffer[id].PushBack(data.x()); m_buffer[id].PushBack(data.y()); } + +vec2 ewol::VirtualBufferObject::GetOnBufferVec2(int32_t id, int32_t elementID) +{ + if (elementID*2>m_buffer[id].Size()) { + return vec2(0,0); + } + return vec2(m_buffer[id][2*elementID], + m_buffer[id][2*elementID+1]); +} + +int32_t ewol::VirtualBufferObject::SizeOnBufferVec2(int32_t id) +{ + return m_buffer[id].Size()/2; +} + diff --git a/sources/ewol/renderer/resources/VirtualBufferObject.h b/sources/ewol/renderer/resources/VirtualBufferObject.h index ab75bb8b..369925dd 100644 --- a/sources/ewol/renderer/resources/VirtualBufferObject.h +++ b/sources/ewol/renderer/resources/VirtualBufferObject.h @@ -26,15 +26,15 @@ namespace ewol { private : bool m_exist; //!< This data is availlable in the Graphic card - int32_t m_nbVBO; //! number of simultaneous VBO GLuint m_vbo[NB_VBO_MAX]; //!< OpenGl ID of this VBO + bool m_vboUsed[NB_VBO_MAX]; //!< true if the VBO is allocated or used ... etk::Vector m_buffer[NB_VBO_MAX]; //!< data that is availlable in the VBO system ... public: /** * @brief Constructor of this VBO. * @param[in] accesMode Acces mode : ??? */ - VirtualBufferObject(const etk::UString& accesMode, int32_t nbElement=4); + VirtualBufferObject(const etk::UString& accesMode); /** * @brief Destructor of this VBO. */ @@ -54,31 +54,23 @@ namespace ewol * @param[in] id Id of the buffer requested * @return A reference on the data. */ - etk::Vector& GetRefBuffer(int32_t id) { return m_buffer[id]; }; - /** - * @brief push data on a buffer with a custum type : - * @param[in] id Id of the buffer requested. - * @param[in] data Direct data that might be set. - */ - void PushOnBuffer(int32_t id, const ivec3& data); + etk::Vector& GetRefBuffer(int32_t id) { m_vboUsed[id] = true; return m_buffer[id]; }; /** * @brief push data on a buffer with a custum type : * @param[in] id Id of the buffer requested. * @param[in] data Direct data that might be set. */ void PushOnBuffer(int32_t id, const vec3& data); - /** - * @brief push data on a buffer with a custum type : - * @param[in] id Id of the buffer requested. - * @param[in] data Direct data that might be set. - */ - void PushOnBuffer(int32_t id, const ivec2& data); + vec3 GetOnBufferVec3(int32_t id, int32_t elementID); + int32_t SizeOnBufferVec3(int32_t id); /** * @brief push data on a buffer with a custum type : * @param[in] id Id of the buffer requested. * @param[in] data Direct data that might be set. */ void PushOnBuffer(int32_t id, const vec2& data); + vec2 GetOnBufferVec2(int32_t id, int32_t elementID); + int32_t SizeOnBufferVec2(int32_t id); /** * @brief Get the data from the graphic card. */