[DEBUG] correct seg fault
This commit is contained in:
parent
2ad64a73fb
commit
95bff828d8
@ -54,7 +54,7 @@ void ewol::compositing::Area::loadProgram() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ewol::compositing::Area::draw(bool _disableDepthTest) {
|
void ewol::compositing::Area::draw(bool _disableDepthTest) {
|
||||||
if (m_coord.size() <= 0) {
|
if (m_VBO->bufferSize(EWOL_COMPOSITING_VBO_COORDINATE) <= 0) {
|
||||||
//EWOL_WARNING("Nothink to draw...");
|
//EWOL_WARNING("Nothink to draw...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -79,7 +79,7 @@ void ewol::compositing::Area::draw(bool _disableDepthTest) {
|
|||||||
// color:
|
// color:
|
||||||
m_GLprogram->sendAttributePointer(m_GLColor, m_VBO, EWOL_COMPOSITING_VBO_TEXTURE);
|
m_GLprogram->sendAttributePointer(m_GLColor, m_VBO, EWOL_COMPOSITING_VBO_TEXTURE);
|
||||||
// Request the draw od the elements :
|
// Request the draw od the elements :
|
||||||
gale::openGL::drawArrays(gale::openGL::renderMode::triangle, 0, m_coord.size());
|
gale::openGL::drawArrays(gale::openGL::renderMode::triangle, 0, m_VBO->bufferSize(EWOL_COMPOSITING_VBO_COORDINATE));
|
||||||
m_GLprogram->unUse();
|
m_GLprogram->unUse();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ void ewol::compositing::Area::clear() {
|
|||||||
// call upper class
|
// call upper class
|
||||||
ewol::Compositing::clear();
|
ewol::Compositing::clear();
|
||||||
// reset all VBOs:
|
// reset all VBOs:
|
||||||
m_VBO.clear();
|
m_VBO->clear();
|
||||||
// reset temporal variables :
|
// reset temporal variables :
|
||||||
m_position = vec3(0.0, 0.0, 0.0);
|
m_position = vec3(0.0, 0.0, 0.0);
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@ namespace ewol {
|
|||||||
class Area : public ewol::Compositing {
|
class Area : public ewol::Compositing {
|
||||||
private:
|
private:
|
||||||
vec3 m_position; //!< The current position to draw
|
vec3 m_position; //!< The current position to draw
|
||||||
etk::Color<> m_color; //!< The text foreground color
|
etk::Color<float,4> m_color; //!< The text foreground color
|
||||||
private:
|
private:
|
||||||
ememory::SharedPtr<gale::resource::Program> m_GLprogram; //!< pointer on the opengl display program
|
ememory::SharedPtr<gale::resource::Program> m_GLprogram; //!< pointer on the opengl display program
|
||||||
int32_t m_GLPosition; //!< openGL id on the element (vertex buffer)
|
int32_t m_GLPosition; //!< openGL id on the element (vertex buffer)
|
||||||
|
@ -180,15 +180,18 @@ void ewol::compositing::Shaper::draw(bool _disableDepthTest) {
|
|||||||
EWOL_ERROR("No shader ...");
|
EWOL_ERROR("No shader ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (m_VBO->bufferSize(EWOL_COMPOSITING_SHAPER_VBO_COORDINATE) <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
//glScalef(m_scaling.x, m_scaling.y, 1.0);
|
//glScalef(m_scaling.x, m_scaling.y, 1.0);
|
||||||
m_GLprogram->use();
|
m_GLprogram->use();
|
||||||
// set Matrix : translation/positionMatrix
|
// set Matrix : translation/positionMatrix
|
||||||
mat4 tmpMatrix = gale::openGL::getMatrix();
|
mat4 tmpMatrix = gale::openGL::getMatrix();
|
||||||
m_GLprogram->uniformMatrix(m_GLMatrix, tmpMatrix);
|
m_GLprogram->uniformMatrix(m_GLMatrix, tmpMatrix);
|
||||||
// position:
|
// position:
|
||||||
m_GLprogram->sendAttributePointer(m_GLPosition, m_VBO, );
|
m_GLprogram->sendAttributePointer(m_GLPosition, m_VBO, EWOL_COMPOSITING_SHAPER_VBO_COORDINATE);
|
||||||
// property
|
// property
|
||||||
m_GLprogram->sendAttributePointer(m_GLPropertyPos, m_VBO, );
|
m_GLprogram->sendAttributePointer(m_GLPropertyPos, m_VBO, EWOL_COMPOSITING_SHAPER_VBO_POS);
|
||||||
// all entry parameters :
|
// all entry parameters :
|
||||||
m_GLprogram->uniform1i(m_GLStateActivate, m_stateActivate);
|
m_GLprogram->uniform1i(m_GLStateActivate, m_stateActivate);
|
||||||
m_GLprogram->uniform1i(m_GLStateOld, m_stateOld);
|
m_GLprogram->uniform1i(m_GLStateOld, m_stateOld);
|
||||||
@ -213,7 +216,7 @@ void ewol::compositing::Shaper::clear() {
|
|||||||
m_propertyOrigin = vec2(0,0);
|
m_propertyOrigin = vec2(0,0);
|
||||||
m_propertyInsidePosition = vec2(0,0);
|
m_propertyInsidePosition = vec2(0,0);
|
||||||
m_propertyInsideSize = vec2(0,0);
|
m_propertyInsideSize = vec2(0,0);
|
||||||
m_VBO->clear()
|
m_VBO->clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ewol::compositing::Shaper::setState(int32_t _newState) {
|
bool ewol::compositing::Shaper::setState(int32_t _newState) {
|
||||||
|
@ -37,18 +37,17 @@ ewol::resource::Colored3DObject::~Colored3DObject() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ewol::resource::Colored3DObject::draw(std::vector<vec3>& _vertices,
|
void ewol::resource::Colored3DObject::draw(const etk::Color<float>& _color,
|
||||||
const etk::Color<float>& _color,
|
|
||||||
bool _updateDepthBuffer,
|
bool _updateDepthBuffer,
|
||||||
bool _depthtest) {
|
bool _depthtest) {
|
||||||
if (_vertices.size() <= 0) {
|
if (m_VBO->bufferSize(EWOL_RESOURCE_COLORED3DOBJECT_VBO_VERTEX_ID) <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_GLprogram == nullptr) {
|
if (m_GLprogram == nullptr) {
|
||||||
EWOL_ERROR("No shader ...");
|
EWOL_ERROR("No shader ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (true == _depthtest) {
|
if (_depthtest == true) {
|
||||||
gale::openGL::enable(gale::openGL::flag_depthTest);
|
gale::openGL::enable(gale::openGL::flag_depthTest);
|
||||||
if (false == _updateDepthBuffer) {
|
if (false == _updateDepthBuffer) {
|
||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
@ -66,7 +65,7 @@ void ewol::resource::Colored3DObject::draw(std::vector<vec3>& _vertices,
|
|||||||
// color :
|
// color :
|
||||||
m_GLprogram->uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&_color);
|
m_GLprogram->uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&_color);
|
||||||
// Request the draw od the elements :
|
// Request the draw od the elements :
|
||||||
gale::openGL::drawArrays(gale::openGL::renderMode::triangle, 0, _vertices.size());
|
gale::openGL::drawArrays(gale::openGL::renderMode::triangle, 0, m_VBO->bufferSize(EWOL_RESOURCE_COLORED3DOBJECT_VBO_VERTEX_ID));
|
||||||
m_GLprogram->unUse();
|
m_GLprogram->unUse();
|
||||||
// Request the draw od the elements :
|
// Request the draw od the elements :
|
||||||
//glDrawArrays(GL_LINES, 0, vertices.size());
|
//glDrawArrays(GL_LINES, 0, vertices.size());
|
||||||
@ -79,12 +78,11 @@ void ewol::resource::Colored3DObject::draw(std::vector<vec3>& _vertices,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::resource::Colored3DObject::draw(std::vector<vec3>& _vertices,
|
void ewol::resource::Colored3DObject::draw(const etk::Color<float>& _color,
|
||||||
const etk::Color<float>& _color,
|
|
||||||
mat4& _transformationMatrix,
|
mat4& _transformationMatrix,
|
||||||
bool _updateDepthBuffer,
|
bool _updateDepthBuffer,
|
||||||
bool _depthtest) {
|
bool _depthtest) {
|
||||||
if (_vertices.size() <= 0) {
|
if (m_VBO->bufferSize(EWOL_RESOURCE_COLORED3DOBJECT_VBO_VERTEX_ID) <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_GLprogram == nullptr) {
|
if (m_GLprogram == nullptr) {
|
||||||
@ -109,7 +107,7 @@ void ewol::resource::Colored3DObject::draw(std::vector<vec3>& _vertices,
|
|||||||
// color :
|
// color :
|
||||||
m_GLprogram->uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&_color);
|
m_GLprogram->uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&_color);
|
||||||
// Request the draw od the elements :
|
// Request the draw od the elements :
|
||||||
gale::openGL::drawArrays(gale::openGL::renderMode::triangle, 0, _vertices.size());
|
gale::openGL::drawArrays(gale::openGL::renderMode::triangle, 0, m_VBO->bufferSize(EWOL_RESOURCE_COLORED3DOBJECT_VBO_VERTEX_ID));
|
||||||
m_GLprogram->unUse();
|
m_GLprogram->unUse();
|
||||||
if (true == _depthtest) {
|
if (true == _depthtest) {
|
||||||
if (false == _updateDepthBuffer) {
|
if (false == _updateDepthBuffer) {
|
||||||
@ -119,12 +117,11 @@ void ewol::resource::Colored3DObject::draw(std::vector<vec3>& _vertices,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ewol::resource::Colored3DObject::drawLine(std::vector<vec3>& _vertices,
|
void ewol::resource::Colored3DObject::drawLine(const etk::Color<float>& _color,
|
||||||
const etk::Color<float>& _color,
|
|
||||||
mat4& _transformationMatrix,
|
mat4& _transformationMatrix,
|
||||||
bool _updateDepthBuffer,
|
bool _updateDepthBuffer,
|
||||||
bool _depthtest) {
|
bool _depthtest) {
|
||||||
if (_vertices.size() <= 0) {
|
if (m_VBO->bufferSize(EWOL_RESOURCE_COLORED3DOBJECT_VBO_VERTEX_ID) <= 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (m_GLprogram == nullptr) {
|
if (m_GLprogram == nullptr) {
|
||||||
@ -149,7 +146,7 @@ void ewol::resource::Colored3DObject::drawLine(std::vector<vec3>& _vertices,
|
|||||||
// color :
|
// color :
|
||||||
m_GLprogram->uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&_color);
|
m_GLprogram->uniform4fv(m_GLColor, 1/*r,g,b,a*/, (float*)&_color);
|
||||||
// Request the draw od the elements :
|
// Request the draw od the elements :
|
||||||
gale::openGL::drawArrays(gale::openGL::renderMode::line, 0, _vertices.size());
|
gale::openGL::drawArrays(gale::openGL::renderMode::line, 0, m_VBO->bufferSize(EWOL_RESOURCE_COLORED3DOBJECT_VBO_VERTEX_ID));
|
||||||
m_GLprogram->unUse();
|
m_GLprogram->unUse();
|
||||||
if (true == _depthtest) {
|
if (true == _depthtest) {
|
||||||
if (false == _updateDepthBuffer) {
|
if (false == _updateDepthBuffer) {
|
||||||
@ -166,7 +163,7 @@ void ewol::resource::Colored3DObject::drawSphere(float _radius,
|
|||||||
mat4& _transformationMatrix,
|
mat4& _transformationMatrix,
|
||||||
const etk::Color<float>& _tmpColor) {
|
const etk::Color<float>& _tmpColor) {
|
||||||
int i, j;
|
int i, j;
|
||||||
m_VBO.clear();
|
m_VBO->clear();
|
||||||
for(i = 0; i <= _lats; i++) {
|
for(i = 0; i <= _lats; i++) {
|
||||||
btScalar lat0 = SIMD_PI * (-btScalar(0.5) + (btScalar) (i - 1) / _lats);
|
btScalar lat0 = SIMD_PI * (-btScalar(0.5) + (btScalar) (i - 1) / _lats);
|
||||||
btScalar z0 = _radius*sin(lat0);
|
btScalar z0 = _radius*sin(lat0);
|
||||||
@ -205,7 +202,7 @@ void ewol::resource::Colored3DObject::drawSphere(float _radius,
|
|||||||
void ewol::resource::Colored3DObject::drawSquare(const vec3& _size,
|
void ewol::resource::Colored3DObject::drawSquare(const vec3& _size,
|
||||||
mat4& _transformationMatrix,
|
mat4& _transformationMatrix,
|
||||||
const etk::Color<float>& _tmpColor){
|
const etk::Color<float>& _tmpColor){
|
||||||
m_VBO.clear();
|
m_VBO->clear();
|
||||||
static int indices[36] = { 0,1,2, 3,2,1, 4,0,6,
|
static int indices[36] = { 0,1,2, 3,2,1, 4,0,6,
|
||||||
6,0,2, 5,1,4, 4,1,0,
|
6,0,2, 5,1,4, 4,1,0,
|
||||||
7,3,1, 7,1,5, 5,4,7,
|
7,3,1, 7,1,5, 5,4,7,
|
||||||
@ -218,7 +215,6 @@ void ewol::resource::Colored3DObject::drawSquare(const vec3& _size,
|
|||||||
vec3(-_size[0],_size[1],-_size[2]),
|
vec3(-_size[0],_size[1],-_size[2]),
|
||||||
vec3(_size[0],-_size[1],-_size[2]),
|
vec3(_size[0],-_size[1],-_size[2]),
|
||||||
vec3(-_size[0],-_size[1],-_size[2])};
|
vec3(-_size[0],-_size[1],-_size[2])};
|
||||||
tmpVertices.clear();
|
|
||||||
for (int32_t iii=0 ; iii<36 ; iii+=3) {
|
for (int32_t iii=0 ; iii<36 ; iii+=3) {
|
||||||
// normal calculation :
|
// normal calculation :
|
||||||
//btVector3 normal = (vertices[indices[iii+2]]-vertices[indices[iii]]).cross(vertices[indices[iii+1]]-vertices[indices[iii]]);
|
//btVector3 normal = (vertices[indices[iii+2]]-vertices[indices[iii]]).cross(vertices[indices[iii+1]]-vertices[indices[iii]]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user