diff --git a/ege/Environement.cpp b/ege/Environement.cpp index 6e398b4..36ff84d 100644 --- a/ege/Environement.cpp +++ b/ege/Environement.cpp @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include #include diff --git a/ege/Light.cpp b/ege/Light.cpp index 8d99987..6540c4d 100644 --- a/ege/Light.cpp +++ b/ege/Light.cpp @@ -27,7 +27,7 @@ ege::Light::~Light() { } -void ege::Light::link(const std::shared_ptr& _prog, const std::string& _baseName) { +void ege::Light::link(const std::shared_ptr& _prog, const std::string& _baseName) { if (nullptr == _prog) { return; } @@ -38,7 +38,7 @@ void ege::Light::link(const std::shared_ptr& _prog, con m_GL_specularColor = _prog->getUniform(_baseName+".specularColor"); } -void ege::Light::draw(const std::shared_ptr& _prog) { +void ege::Light::draw(const std::shared_ptr& _prog) { _prog->uniform3(m_GL_direction, m_direction); _prog->uniform3(m_GL_halfplane, m_halfplane); _prog->uniform4(m_GL_ambientColor, m_ambientColor); diff --git a/ege/Light.h b/ege/Light.h index e8a0da0..aac5bb1 100644 --- a/ege/Light.h +++ b/ege/Light.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include namespace ege { class Light { @@ -33,8 +33,8 @@ namespace ege { public: Light(); ~Light(); - void link(const std::shared_ptr& _prog, const std::string& _baseName); - void draw(const std::shared_ptr& _prog); + void link(const std::shared_ptr& _prog, const std::string& _baseName); + void draw(const std::shared_ptr& _prog); void setDirection(const vec3& val) { m_direction = val; } diff --git a/ege/Material.cpp b/ege/Material.cpp index a7aee23..6db36a0 100644 --- a/ege/Material.cpp +++ b/ege/Material.cpp @@ -6,7 +6,7 @@ * @license BSD v3 (see license file) */ -#include +#include #include #include @@ -19,7 +19,7 @@ ege::MaterialGlId::MaterialGlId() : // nothing to do else ... } -void ege::MaterialGlId::link(const std::shared_ptr& _prog, const std::string& _baseName) { +void ege::MaterialGlId::link(const std::shared_ptr& _prog, const std::string& _baseName) { if (nullptr == _prog) { return; } @@ -35,7 +35,7 @@ ege::Material::Material() : m_diffuseFactor(0,0,0,1), m_specularFactor(0,0,0,1), m_shininess(1), - m_renderMode(ewol::openGL::renderTriangle), + m_renderMode(gale::openGL::render_triangle), m_texture0(nullptr) { // nothing to do else ... } @@ -44,7 +44,7 @@ ege::Material::~Material() { } -void ege::Material::draw(const std::shared_ptr& _prog, const MaterialGlId& _glID) { +void ege::Material::draw(const std::shared_ptr& _prog, const MaterialGlId& _glID) { _prog->uniform4(_glID.m_GL_ambientFactor, m_ambientFactor); _prog->uniform4(_glID.m_GL_diffuseFactor, m_diffuseFactor); _prog->uniform4(_glID.m_GL_specularFactor, m_specularFactor); @@ -100,45 +100,45 @@ void ege::Material::setTexture0Magic(const ivec2& _size) { } } -int32_t ege::Material::getRenderModeOpenGl() { - return static_cast(m_renderMode); +enum gale::openGL::renderMode ege::Material::getRenderModeOpenGl() { + return m_renderMode; } -void ege::Material::setRenderMode(enum ewol::openGL::renderMode _val) { +void ege::Material::setRenderMode(enum gale::openGL::renderMode _val) { switch (_val) { - case ewol::openGL::renderPoint: + case gale::openGL::render_point: break; - case ewol::openGL::renderLine: + case gale::openGL::render_line: break; - case ewol::openGL::renderLineStrip: + case gale::openGL::render_lineStrip: EGE_INFO("Does not support " << _val << " auto convert it in 'LINE'"); - _val = ewol::openGL::renderLine; + _val = gale::openGL::render_line; break; - case ewol::openGL::renderLineLoop: + case gale::openGL::render_lineLoop: EGE_INFO("Does not support " << _val << " auto convert it in 'LINE'"); - _val = ewol::openGL::renderLine; + _val = gale::openGL::render_line; break; - case ewol::openGL::renderTriangle: + case gale::openGL::render_triangle: break; - case ewol::openGL::renderTriangleStrip: + case gale::openGL::render_triangleStrip: EGE_INFO("Does not support " << _val << " auto convert it in 'TRIANGLE'"); - _val = ewol::openGL::renderTriangle; + _val = gale::openGL::render_triangle; break; - case ewol::openGL::renderTriangleFan: + case gale::openGL::render_triangleFan: EGE_INFO("Does not support " << _val << " auto convert it in 'TRIANGLE'"); - _val = ewol::openGL::renderTriangle; + _val = gale::openGL::render_triangle; break; - case ewol::openGL::renderQuad: + case gale::openGL::render_quad: EGE_INFO("Does not support " << _val << " auto convert it in 'TRIANGLE'"); - _val = ewol::openGL::renderTriangle; + _val = gale::openGL::render_triangle; break; - case ewol::openGL::renderQuadStrip: + case gale::openGL::render_quadStrip: EGE_INFO("Does not support " << _val << " auto convert it in 'TRIANGLE'"); - _val = ewol::openGL::renderTriangle; + _val = gale::openGL::render_triangle; break; - case ewol::openGL::renderPolygon: + case gale::openGL::render_polygon: EGE_ERROR("Does not support " << _val << " try convert it in 'TRIANGLE'"); - _val = ewol::openGL::renderTriangle; + _val = gale::openGL::render_triangle; break; } m_renderMode = _val; diff --git a/ege/Material.h b/ege/Material.h index 4eb2189..ef95e82 100644 --- a/ege/Material.h +++ b/ege/Material.h @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include namespace ege { @@ -28,7 +28,7 @@ namespace ege { int32_t m_GL_shininess; int32_t m_GL_texture0; MaterialGlId(); - void link(const std::shared_ptr& _prog, const std::string& _baseName); + void link(const std::shared_ptr& _prog, const std::string& _baseName); }; @@ -39,14 +39,14 @@ namespace ege { vec4 m_diffuseFactor; vec4 m_specularFactor; float m_shininess; - enum ewol::openGL::renderMode m_renderMode; // Select Render mode (triangle/Line/point ...) + enum gale::openGL::renderMode m_renderMode; // Select Render mode (triangle/Line/point ...) std::shared_ptr m_texture0; public: std::vector m_listIndexFaces; public: Material(); ~Material(); - void draw(const std::shared_ptr& _prog, const ege::MaterialGlId& _glID); + void draw(const std::shared_ptr& _prog, const ege::MaterialGlId& _glID); void setAmbientFactor(const vec4& _val) { m_ambientFactor = _val; } @@ -59,9 +59,9 @@ namespace ege { void setShininess(float _val) { m_shininess = _val; } - void setRenderMode(enum ewol::openGL::renderMode _val); - int32_t getRenderModeOpenGl(); - enum ewol::openGL::renderMode getRenderMode() { + void setRenderMode(enum gale::openGL::renderMode _val); + enum gale::openGL::renderMode getRenderModeOpenGl(); + enum gale::openGL::renderMode getRenderMode() { return m_renderMode; } void setTexture0(const std::string& _filename); diff --git a/ege/camera/Camera.cpp b/ege/camera/Camera.cpp index 5b95854..a596495 100644 --- a/ege/camera/Camera.cpp +++ b/ege/camera/Camera.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #undef __class__ #define __class__ "Camera" @@ -62,8 +62,8 @@ void ege::Camera::updateProjectionMatrix() { } void ege::Camera::configureOpenGL() { - ewol::openGL::setCameraMatrix(getMatrixCamera()); - ewol::openGL::setMatrix(getMatrixProjection()); + gale::openGL::setCameraMatrix(getMatrixCamera()); + gale::openGL::setMatrix(getMatrixProjection()); } diff --git a/ege/elements/Element.h b/ege/elements/Element.h index 71f06fe..64fda90 100644 --- a/ege/elements/Element.h +++ b/ege/elements/Element.h @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/ege/elements/ElementPhysic.h b/ege/elements/ElementPhysic.h index 5f85bc6..450bb3b 100644 --- a/ege/elements/ElementPhysic.h +++ b/ege/elements/ElementPhysic.h @@ -15,7 +15,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/ege/physics/Engine.cpp b/ege/physics/Engine.cpp index 5903724..b985dec 100644 --- a/ege/physics/Engine.cpp +++ b/ege/physics/Engine.cpp @@ -10,7 +10,7 @@ #include -#include +#include #include #include #include diff --git a/ege/physics/Engine.h b/ege/physics/Engine.h index 54709f8..74ef140 100644 --- a/ege/physics/Engine.h +++ b/ege/physics/Engine.h @@ -21,9 +21,9 @@ namespace ege { #include #include #include -#include -#include -#include +#include +#include +#include class btBroadphaseInterface; diff --git a/ege/resource/Mesh.cpp b/ege/resource/Mesh.cpp index 69875a8..31f1ce8 100644 --- a/ege/resource/Mesh.cpp +++ b/ege/resource/Mesh.cpp @@ -8,7 +8,8 @@ #include #include -#include +#include +#include #include #include #include @@ -30,12 +31,11 @@ ege::resource::Mesh::Mesh() : m_numberOfElments(-1), m_pointerShape(nullptr), m_functionFreeShape(nullptr) { - addObjectType("ege::resource::Mesh"); + addResourceType("ege::resource::Mesh"); } void ege::resource::Mesh::init(const std::string& _fileName, const std::string& _shaderName) { - ewol::Resource::init(_fileName); - addObjectType("ege::resource::Mesh"); + gale::Resource::init(_fileName); EGE_VERBOSE("Load a new mesh : '" << _fileName << "'"); // get the shader resource : m_GLPosition = 0; @@ -47,7 +47,7 @@ void ege::resource::Mesh::init(const std::string& _fileName, const std::string& m_light.setSpecularColor(vec4(0.0f,0.0f,0.0f,1.0f)); //EGE_DEBUG(m_name << " " << m_light); - m_GLprogram = ewol::resource::Program::create(_shaderName); + m_GLprogram = gale::resource::Program::create(_shaderName); if (m_GLprogram != nullptr) { m_GLPosition = m_GLprogram->getAttribute("EW_coord3d"); m_GLtexture = m_GLprogram->getAttribute("EW_texture2d"); @@ -60,7 +60,7 @@ void ege::resource::Mesh::init(const std::string& _fileName, const std::string& m_light.link(m_GLprogram, "EW_directionalLight"); } // this is the properties of the buffer requested : "r"/"w" + "-" + buffer type "f"=flaot "i"=integer - m_verticesVBO = ewol::resource::VirtualBufferObject::create(5); + m_verticesVBO = gale::resource::VirtualBufferObject::create(5); if (m_verticesVBO == nullptr) { EGE_ERROR("can not instanciate VBO ..."); return; @@ -118,18 +118,18 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix, } //EGE_DEBUG(m_name << " " << m_light); if (_enableDepthTest == true) { - ewol::openGL::enable(ewol::openGL::FLAG_DEPTH_TEST); + gale::openGL::enable(gale::openGL::flag_depthTest); if (false == _enableDepthUpdate) { glDepthMask(GL_FALSE); } } else { - ewol::openGL::disable(ewol::openGL::FLAG_DEPTH_TEST); + gale::openGL::disable(gale::openGL::flag_depthTest); } //EGE_DEBUG(" display " << m_coord.size() << " elements" ); m_GLprogram->use(); // set Matrix : translation/positionMatrix - mat4 projMatrix = ewol::openGL::getMatrix(); - mat4 camMatrix = ewol::openGL::getCameraMatrix(); + mat4 projMatrix = gale::openGL::getMatrix(); + mat4 camMatrix = gale::openGL::getCameraMatrix(); mat4 tmpMatrix = projMatrix * camMatrix; m_GLprogram->uniformMatrix(m_GLMatrix, tmpMatrix); m_GLprogram->uniformMatrix(m_GLMatrixPosition, _positionMatrix); @@ -165,7 +165,7 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix, } m_materials[m_listFaces.getKey(kkk)]->draw(m_GLprogram, m_GLMaterial); if (m_checkNormal == false) { - ewol::openGL::drawElements(m_materials[m_listFaces.getKey(kkk)]->getRenderModeOpenGl(), m_listFaces.getValue(kkk).m_index); + gale::openGL::drawElements(m_materials[m_listFaces.getKey(kkk)]->getRenderModeOpenGl(), m_listFaces.getValue(kkk).m_index); #ifdef DISPLAY_NB_VERTEX_DISPLAYED nbElementDraw += m_listFaces.getValue(kkk).m_index.size(); nbElementDrawTheoric += m_listFaces.getValue(kkk).m_index.size(); @@ -211,7 +211,7 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix, } break; } - ewol::openGL::drawElements(m_materials[m_listFaces.getKey(kkk)]->getRenderModeOpenGl(), tmpIndexResult); + gale::openGL::drawElements(m_materials[m_listFaces.getKey(kkk)]->getRenderModeOpenGl(), tmpIndexResult); #ifdef DISPLAY_NB_VERTEX_DISPLAYED nbElementDraw += tmpIndexResult.size(); nbElementDrawTheoric += m_listFaces.getValue(kkk).m_index.size(); @@ -235,7 +235,7 @@ void ege::resource::Mesh::draw(mat4& _positionMatrix, if (false == _enableDepthUpdate) { glDepthMask(GL_TRUE); } - ewol::openGL::disable(ewol::openGL::FLAG_DEPTH_TEST); + gale::openGL::disable(gale::openGL::flag_depthTest); } // TODO : UNDERSTAND why ... it is needed glBindBuffer(GL_ARRAY_BUFFER,0); @@ -247,11 +247,11 @@ void ege::resource::Mesh::calculateNormaleFace(const std::string& _materialName) m_listFacesNormal.clear(); if (m_normalMode == ege::resource::Mesh::normalModeFace) { EGE_INFO("calculateNormaleFace(" << _materialName << ")"); - ewol::openGL::renderMode tmpRenderMode = m_materials[_materialName]->getRenderMode(); - if ( tmpRenderMode == ewol::openGL::renderPoint - || tmpRenderMode == ewol::openGL::renderLine - || tmpRenderMode == ewol::openGL::renderLineStrip - || tmpRenderMode == ewol::openGL::renderLineLoop) { + gale::openGL::renderMode tmpRenderMode = m_materials[_materialName]->getRenderMode(); + if ( tmpRenderMode == gale::openGL::render_point + || tmpRenderMode == gale::openGL::render_line + || tmpRenderMode == gale::openGL::render_lineStrip + || tmpRenderMode == gale::openGL::render_lineLoop) { EGE_ERROR("calculateNormaleFace(" << _materialName << ") : can not calculate normal on lines ..."); m_normalMode = ege::resource::Mesh::normalModeNone; return; @@ -269,11 +269,11 @@ void ege::resource::Mesh::calculateNormaleEdge(const std::string& _materialName) m_listVertexNormal.clear(); if (m_normalMode == ege::resource::Mesh::normalModeVertex) { EGE_INFO("calculateNormaleEdge(" << _materialName << ")"); - ewol::openGL::renderMode tmpRenderMode = m_materials[_materialName]->getRenderMode(); - if ( tmpRenderMode == ewol::openGL::renderPoint - || tmpRenderMode == ewol::openGL::renderLine - || tmpRenderMode == ewol::openGL::renderLineStrip - || tmpRenderMode == ewol::openGL::renderLineLoop) { + gale::openGL::renderMode tmpRenderMode = m_materials[_materialName]->getRenderMode(); + if ( tmpRenderMode == gale::openGL::render_point + || tmpRenderMode == gale::openGL::render_line + || tmpRenderMode == gale::openGL::render_lineStrip + || tmpRenderMode == gale::openGL::render_lineLoop) { EGE_ERROR("calculateNormaleEdge(" << _materialName << ") : can not calculate normal on lines ..."); m_normalMode = ege::resource::Mesh::normalModeNone; return; @@ -319,24 +319,24 @@ void ege::resource::Mesh::generateVBO() { m_listFaces.getValue(kkk).m_index.clear(); int32_t nbIndicInFace = 3; switch (m_materials[m_listFaces.getKey(kkk)]->getRenderMode()) { - case ewol::openGL::renderTriangle: - case ewol::openGL::renderTriangleStrip: - case ewol::openGL::renderTriangleFan: + case gale::openGL::render_triangle: + case gale::openGL::render_triangleStrip: + case gale::openGL::render_triangleFan: nbIndicInFace = 3; break; - case ewol::openGL::renderLine: - case ewol::openGL::renderLineStrip: - case ewol::openGL::renderLineLoop: + case gale::openGL::render_line: + case gale::openGL::render_lineStrip: + case gale::openGL::render_lineLoop: nbIndicInFace = 2; break; - case ewol::openGL::renderPoint: + case gale::openGL::render_point: nbIndicInFace = 1; break; - case ewol::openGL::renderQuad: - case ewol::openGL::renderQuadStrip: + case gale::openGL::render_quad: + case gale::openGL::render_quadStrip: nbIndicInFace = 4; break; - case ewol::openGL::renderPolygon: + case gale::openGL::render_polygon: nbIndicInFace = 3; break; } @@ -493,8 +493,8 @@ void ege::resource::Mesh::addPoint(const std::string& _layerName, const vec3& _p EGE_ERROR("Mesh layer : " << _layerName << " does not exist in list faces=" << m_listFaces.exist(_layerName) << " materials=" << m_listFaces.exist(_layerName) << " ..."); return; } - ewol::openGL::renderMode tmpRenderMode = m_materials[_layerName]->getRenderMode(); - if (tmpRenderMode != ewol::openGL::renderPoint) { + gale::openGL::renderMode tmpRenderMode = m_materials[_layerName]->getRenderMode(); + if (tmpRenderMode != gale::openGL::render_point) { EGE_ERROR("try to add Point in a mesh material section that not support Point"); return; } @@ -514,10 +514,10 @@ void ege::resource::Mesh::addLine(const std::string& _layerName, const vec3& _po EGE_ERROR("Mesh layer : " << _layerName << " does not exist in list faces=" << m_listFaces.exist(_layerName) << " materials=" << m_listFaces.exist(_layerName) << " ..."); return; } - ewol::openGL::renderMode tmpRenderMode = m_materials[_layerName]->getRenderMode(); - if ( tmpRenderMode != ewol::openGL::renderLine - && tmpRenderMode != ewol::openGL::renderLineStrip - && tmpRenderMode != ewol::openGL::renderLineLoop) { + gale::openGL::renderMode tmpRenderMode = m_materials[_layerName]->getRenderMode(); + if ( tmpRenderMode != gale::openGL::render_line + && tmpRenderMode != gale::openGL::render_lineStrip + && tmpRenderMode != gale::openGL::render_lineLoop) { EGE_ERROR("try to add Line in a mesh material section that not support Line"); return; } @@ -559,10 +559,10 @@ void ege::resource::Mesh::addTriangle(const std::string& _layerName, EGE_ERROR("Mesh layer : " << _layerName << " does not exist in list faces=" << m_listFaces.exist(_layerName) << " materials=" << m_listFaces.exist(_layerName) << " ..."); return; } - ewol::openGL::renderMode tmpRenderMode = m_materials[_layerName]->getRenderMode(); - if ( tmpRenderMode != ewol::openGL::renderTriangle - && tmpRenderMode != ewol::openGL::renderTriangleStrip - && tmpRenderMode != ewol::openGL::renderTriangleFan) { + gale::openGL::renderMode tmpRenderMode = m_materials[_layerName]->getRenderMode(); + if ( tmpRenderMode != gale::openGL::render_triangle + && tmpRenderMode != gale::openGL::render_triangleStrip + && tmpRenderMode != gale::openGL::render_triangleFan) { EGE_ERROR("try to add Line in a mesh material section that not support Line"); return; } @@ -592,13 +592,13 @@ void ege::resource::Mesh::addTriangle(const std::string& _layerName, const vec3& EGE_ERROR("Mesh layer : " << _layerName << " does not exist in list faces=" << m_listFaces.exist(_layerName) << " materials=" << m_listFaces.exist(_layerName) << " ..."); return; } - ewol::openGL::renderMode tmpRenderMode = m_materials[_layerName]->getRenderMode(); - if ( tmpRenderMode == ewol::openGL::renderQuad - || tmpRenderMode == ewol::openGL::renderQuadStrip) { + gale::openGL::renderMode tmpRenderMode = m_materials[_layerName]->getRenderMode(); + if ( tmpRenderMode == gale::openGL::render_quad + || tmpRenderMode == gale::openGL::render_quadStrip) { EGE_TODO("Create quad interface ..."); - } else if ( tmpRenderMode == ewol::openGL::renderTriangle - || tmpRenderMode == ewol::openGL::renderLineStrip - || tmpRenderMode == ewol::openGL::renderTriangleFan) { + } else if ( tmpRenderMode == gale::openGL::render_triangle + || tmpRenderMode == gale::openGL::render_lineStrip + || tmpRenderMode == gale::openGL::render_triangleFan) { // try to find position: int32_t pos1 = findPositionInList(_pos1); diff --git a/ege/resource/Mesh.h b/ege/resource/Mesh.h index 3efc184..7fb8eae 100644 --- a/ege/resource/Mesh.h +++ b/ege/resource/Mesh.h @@ -11,11 +11,11 @@ #include #include -#include +#include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -31,7 +31,7 @@ namespace ege { namespace resource { - class Mesh : public ewol::Resource { + class Mesh : public gale::Resource { public: static std::shared_ptr createGrid(int32_t _lineCount, const vec3& _position=vec3(0,0,0), float _size=1.0f, const std::string& _materialName="basics"); static std::shared_ptr createCube(float _size=1.0f, const std::string& _materialName="basics", const etk::Color& _color=etk::color::white); @@ -48,7 +48,7 @@ namespace ege { enum normalMode m_normalMode; // select the normal mode of display bool m_checkNormal; //!< when enable, this check the normal of the mesh before sending it at the 3d card protected: - std::shared_ptr m_GLprogram; + std::shared_ptr m_GLprogram; int32_t m_GLPosition; int32_t m_GLMatrix; int32_t m_GLMatrixPosition; @@ -70,7 +70,7 @@ namespace ege { std::vector> m_physics; //!< collision shape module ... (independent of bullet lib) void clean(); protected: - std::shared_ptr m_verticesVBO; + std::shared_ptr m_verticesVBO; protected: Mesh(); void init(const std::string& _fileName="---", const std::string& _shaderName="DATA:textured3D2.prog"); diff --git a/ege/resource/MeshCube.cpp b/ege/resource/MeshCube.cpp index ae9f78e..67b51eb 100644 --- a/ege/resource/MeshCube.cpp +++ b/ege/resource/MeshCube.cpp @@ -19,7 +19,7 @@ std::shared_ptr ege::resource::Mesh::createCube(float _size material->setDiffuseFactor(vec4(0,0,0,1)); material->setSpecularFactor(vec4(0,0,0,1)); material->setShininess(1); - material->setRenderMode(ewol::openGL::renderTriangle); + material->setRenderMode(gale::openGL::render_triangle); out->addMaterial(_materialName, material); out->addFaceIndexing(_materialName); diff --git a/ege/resource/MeshEmf.cpp b/ege/resource/MeshEmf.cpp index 310c991..e4ee9f5 100644 --- a/ege/resource/MeshEmf.cpp +++ b/ege/resource/MeshEmf.cpp @@ -483,7 +483,7 @@ bool ege::resource::Mesh::loadEMF(const std::string& _fileName) { material->setTexture0(fileName.getRelativeFolder() + &inputDataLine[7]); EGE_VERBOSE(" Texture " << &inputDataLine[7]); } else if(0 == strncmp(inputDataLine,"renderMode ",11)) { - ewol::openGL::renderMode mode; + gale::openGL::renderMode mode; etk::from_string(mode, &inputDataLine[11]); material->setRenderMode(mode); EGE_VERBOSE(" Texture " << mode); diff --git a/ege/resource/MeshGird.cpp b/ege/resource/MeshGird.cpp index 25381c9..ece9d42 100644 --- a/ege/resource/MeshGird.cpp +++ b/ege/resource/MeshGird.cpp @@ -18,8 +18,8 @@ std::shared_ptr ege::resource::Mesh::createGrid(int32_t _li material->setDiffuseFactor(vec4(0,0,0,1)); material->setSpecularFactor(vec4(0,0,0,1)); material->setShininess(1); - material->setRenderMode(ewol::openGL::renderLine); - //material->setRenderMode(ewol::openGL::renderPoint); + material->setRenderMode(gale::openGL::render_line); + //material->setRenderMode(gale::openGL::render_point); out->addMaterial(_materialName, material); out->addFaceIndexing(_materialName); diff --git a/ege/resource/ParticuleMesh.cpp b/ege/resource/ParticuleMesh.cpp index 3872bfe..2226f3a 100644 --- a/ege/resource/ParticuleMesh.cpp +++ b/ege/resource/ParticuleMesh.cpp @@ -8,10 +8,11 @@ #include #include -#include +#include +#include ege::resource::ParticuleMesh::ParticuleMesh() { - addObjectType("ege::resource::ParticuleMesh"); + addResourceType("ege::resource::ParticuleMesh"); } void ege::resource::ParticuleMesh::init(const std::string& _fileName, const std::string& _shaderName) { @@ -36,18 +37,18 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix, } //EGE_DEBUG(m_name << " " << m_light); if (_enableDepthTest == true) { - ewol::openGL::enable(ewol::openGL::FLAG_DEPTH_TEST); + gale::openGL::enable(gale::openGL::flag_depthTest); if (false == _enableDepthUpdate) { glDepthMask(GL_FALSE); } } else { - ewol::openGL::disable(ewol::openGL::FLAG_DEPTH_TEST); + gale::openGL::disable(gale::openGL::flag_depthTest); } //EGE_DEBUG(" display " << m_coord.size() << " elements" ); m_GLprogram->use(); // set Matrix : translation/positionMatrix - mat4 projMatrix = ewol::openGL::getMatrix(); - mat4 camMatrix = ewol::openGL::getCameraMatrix(); + mat4 projMatrix = gale::openGL::getMatrix(); + mat4 camMatrix = gale::openGL::getCameraMatrix(); mat4 tmpMatrix = projMatrix * camMatrix; m_GLprogram->uniformMatrix(m_GLMatrix, tmpMatrix); m_GLprogram->uniformMatrix(m_GLMatrixPosition, _positionMatrix); @@ -72,7 +73,7 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix, } m_materials[m_listFaces.getKey(kkk)]->draw(m_GLprogram, m_GLMaterial); if (m_checkNormal == false) { - ewol::openGL::drawElements(GL_TRIANGLES, m_listFaces.getValue(kkk).m_index); + gale::openGL::drawElements(gale::openGL::render_triangle, m_listFaces.getValue(kkk).m_index); #ifdef DISPLAY_NB_VERTEX_DISPLAYED nbElementDraw += m_listFaces.getValue(kkk).m_index.size(); nbElementDrawTheoric += m_listFaces.getValue(kkk).m_index.size(); @@ -108,7 +109,7 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix, } } } - ewol::openGL::drawElements(GL_TRIANGLES, tmpIndexResult); + gale::openGL::drawElements(gale::openGL::render_triangle, tmpIndexResult); #ifdef DISPLAY_NB_VERTEX_DISPLAYED nbElementDraw += tmpIndexResult.size(); nbElementDrawTheoric += m_listFaces.getValue(kkk).m_index.size(); @@ -123,7 +124,7 @@ void ege::resource::ParticuleMesh::draw(mat4& _positionMatrix, if (false == _enableDepthUpdate) { glDepthMask(GL_TRUE); } - ewol::openGL::disable(ewol::openGL::FLAG_DEPTH_TEST); + gale::openGL::disable(gale::openGL::flag_depthTest); } glBindBuffer(GL_ARRAY_BUFFER,0); } diff --git a/ege/widget/Mesh.cpp b/ege/widget/Mesh.cpp index 45fc831..2d2edd6 100644 --- a/ege/widget/Mesh.cpp +++ b/ege/widget/Mesh.cpp @@ -8,7 +8,7 @@ #include #include -#include +#include #include #undef __class__ @@ -54,22 +54,19 @@ void ege::widget::Mesh::onDraw() { } void ege::widget::Mesh::systemDraw(const ewol::DrawProperty& _displayProp) { - ewol::openGL::push(); + gale::openGL::push(); // here we invert the reference of the standard openGl view because the reference in the common display is Top left and not buttom left - glViewport( m_origin.x(), - m_origin.y(), - m_size.x(), - m_size.y()); + gale::openGL::setViewPort(m_origin, m_size); float ratio = m_size.x() / m_size.y(); //EGE_INFO("ratio : " << ratio); mat4 tmpProjection = etk::matPerspective(M_PI/3.0, ratio, 0.5, 100); //mat4 tmpMat = tmpProjection * m_camera.getMatrix(); // set internal matrix system : //ewol::openGL::setMatrix(tmpMat); - ewol::openGL::setMatrix(tmpProjection); + gale::openGL::setMatrix(tmpProjection); onDraw(); - ewol::openGL::pop(); + gale::openGL::pop(); } void ege::widget::Mesh::onRegenerateDisplay() { @@ -85,8 +82,8 @@ void ege::widget::Mesh::periodicCall(const ewol::event::Time& _event) { bool ege::widget::Mesh::onEventInput(const ewol::event::Input& _event) { //EGE_DEBUG("Event on BT ..."); - if (1 == _event.getId()) { - if(ewol::key::statusSingle == _event.getStatus()) { + if (_event.getId() == 1) { + if(_event.getStatus() == gale::key::status_single) { signalPressed.emit(); return true; } @@ -95,7 +92,7 @@ bool ege::widget::Mesh::onEventInput(const ewol::event::Input& _event) { } void ege::widget::Mesh::setFile(const std::string& _filename) { - if( _filename!="" + if( _filename != "" && m_meshName != _filename ) { m_meshName = _filename; m_object = ege::resource::Mesh::create(m_meshName); diff --git a/ege/widget/Scene.cpp b/ege/widget/Scene.cpp index 0e15f6a..4e29662 100644 --- a/ege/widget/Scene.cpp +++ b/ege/widget/Scene.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include #include @@ -168,20 +168,17 @@ void ege::widget::Scene::systemDraw(const ewol::DrawProperty& _displayProp) { #ifdef SCENE_BRUT_PERFO_TEST int64_t tmp___startTime0 = ewol::getTime(); #endif - glBindBuffer(GL_ARRAY_BUFFER,0); - ewol::openGL::push(); + gale::openGL::bindBuffer(0); + gale::openGL::push(); // here we invert the reference of the standard openGl view because the reference in the common display is Top left and not buttom left - glViewport( m_origin.x(), - m_origin.y(), - m_size.x(), - m_size.y()); + gale::openGL::setViewPort(m_origin, m_size); // configure render with the camera... std::shared_ptr camera = m_env->getCamera(m_cameraName); if (camera != nullptr) { camera->configureOpenGL(); } onDraw(); - ewol::openGL::pop(); + gale::openGL::pop(); #ifdef SCENE_BRUT_PERFO_TEST float tmp___localTime1 = (float)(ewol::getTime() - tmp___startTime0) / 1000.0f; EWOL_DEBUG(" SCENE render : " << tmp___localTime1 << "ms "); diff --git a/ege/widget/Scene.h b/ege/widget/Scene.h index 498deaf..98c7528 100644 --- a/ege/widget/Scene.h +++ b/ege/widget/Scene.h @@ -16,10 +16,10 @@ #include #include #include -#include -#include +#include +#include #include -#include +#include class btBroadphaseInterface; class btCollisionShape; diff --git a/sample/CameraPosition/appl/main.cpp b/sample/CameraPosition/appl/main.cpp index ba5e841..946e920 100644 --- a/sample/CameraPosition/appl/main.cpp +++ b/sample/CameraPosition/appl/main.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/sample/Collision/appl/main.cpp b/sample/Collision/appl/main.cpp index ba5e841..946e920 100644 --- a/sample/Collision/appl/main.cpp +++ b/sample/Collision/appl/main.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/sample/DoubleView/appl/main.cpp b/sample/DoubleView/appl/main.cpp index ba5e841..946e920 100644 --- a/sample/DoubleView/appl/main.cpp +++ b/sample/DoubleView/appl/main.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/sample/MeshCreator/appl/main.cpp b/sample/MeshCreator/appl/main.cpp index ba5e841..946e920 100644 --- a/sample/MeshCreator/appl/main.cpp +++ b/sample/MeshCreator/appl/main.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include diff --git a/sample/RayTest/appl/main.cpp b/sample/RayTest/appl/main.cpp index ba5e841..946e920 100644 --- a/sample/RayTest/appl/main.cpp +++ b/sample/RayTest/appl/main.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include #include #include