[DEV] add some capacity at the 3d direct draw
This commit is contained in:
parent
0de61c3dc1
commit
7df6071476
@ -34,7 +34,8 @@ ewol::Colored3DObject::~Colored3DObject(void)
|
|||||||
|
|
||||||
void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
|
void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
|
||||||
const draw::Colorf& color,
|
const draw::Colorf& color,
|
||||||
bool updateDepthBuffer)
|
bool updateDepthBuffer,
|
||||||
|
bool depthtest)
|
||||||
{
|
{
|
||||||
if (vertices.Size()<=0) {
|
if (vertices.Size()<=0) {
|
||||||
return;
|
return;
|
||||||
@ -43,10 +44,12 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
|
|||||||
EWOL_ERROR("No shader ...");
|
EWOL_ERROR("No shader ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (true==depthtest) {
|
||||||
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
|
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
|
||||||
if (false==updateDepthBuffer) {
|
if (false==updateDepthBuffer) {
|
||||||
glDepthMask(GL_FALSE);
|
glDepthMask(GL_FALSE);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
|
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
|
||||||
m_GLprogram->Use();
|
m_GLprogram->Use();
|
||||||
// set Matrix : translation/positionMatrix
|
// set Matrix : translation/positionMatrix
|
||||||
@ -64,15 +67,19 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
|
|||||||
// Request the draw od the elements :
|
// Request the draw od the elements :
|
||||||
//glDrawArrays(GL_LINES, 0, vertices.Size());
|
//glDrawArrays(GL_LINES, 0, vertices.Size());
|
||||||
//m_GLprogram->UnUse();
|
//m_GLprogram->UnUse();
|
||||||
|
if (true==depthtest) {
|
||||||
if (false==updateDepthBuffer) {
|
if (false==updateDepthBuffer) {
|
||||||
glDepthMask(GL_TRUE);
|
glDepthMask(GL_TRUE);
|
||||||
}
|
}
|
||||||
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
|
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
|
void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
|
||||||
const draw::Colorf& color,
|
const draw::Colorf& color,
|
||||||
mat4& transformationMatrix)
|
mat4& transformationMatrix,
|
||||||
|
bool updateDepthBuffer,
|
||||||
|
bool depthtest)
|
||||||
{
|
{
|
||||||
if (vertices.Size()<=0) {
|
if (vertices.Size()<=0) {
|
||||||
return;
|
return;
|
||||||
@ -81,7 +88,12 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
|
|||||||
EWOL_ERROR("No shader ...");
|
EWOL_ERROR("No shader ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (true==depthtest) {
|
||||||
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
|
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
|
||||||
|
if (false==updateDepthBuffer) {
|
||||||
|
glDepthMask(GL_FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
|
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
|
||||||
m_GLprogram->Use();
|
m_GLprogram->Use();
|
||||||
// set Matrix : translation/positionMatrix
|
// set Matrix : translation/positionMatrix
|
||||||
@ -96,12 +108,19 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
|
|||||||
// Request the draw od the elements :
|
// Request the draw od the elements :
|
||||||
ewol::openGL::DrawArrays(GL_TRIANGLES, 0, vertices.Size());
|
ewol::openGL::DrawArrays(GL_TRIANGLES, 0, vertices.Size());
|
||||||
m_GLprogram->UnUse();
|
m_GLprogram->UnUse();
|
||||||
|
if (true==depthtest) {
|
||||||
|
if (false==updateDepthBuffer) {
|
||||||
|
glDepthMask(GL_TRUE);
|
||||||
|
}
|
||||||
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
|
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ewol::Colored3DObject::DrawLine(etk::Vector<vec3>& vertices,
|
void ewol::Colored3DObject::DrawLine(etk::Vector<vec3>& vertices,
|
||||||
const draw::Colorf& color,
|
const draw::Colorf& color,
|
||||||
mat4& transformationMatrix)
|
mat4& transformationMatrix,
|
||||||
|
bool updateDepthBuffer,
|
||||||
|
bool depthtest)
|
||||||
{
|
{
|
||||||
if (vertices.Size()<=0) {
|
if (vertices.Size()<=0) {
|
||||||
return;
|
return;
|
||||||
@ -110,7 +129,12 @@ void ewol::Colored3DObject::DrawLine(etk::Vector<vec3>& vertices,
|
|||||||
EWOL_ERROR("No shader ...");
|
EWOL_ERROR("No shader ...");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (true==depthtest) {
|
||||||
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
|
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
|
||||||
|
if (false==updateDepthBuffer) {
|
||||||
|
glDepthMask(GL_FALSE);
|
||||||
|
}
|
||||||
|
}
|
||||||
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
|
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
|
||||||
m_GLprogram->Use();
|
m_GLprogram->Use();
|
||||||
// set Matrix : translation/positionMatrix
|
// set Matrix : translation/positionMatrix
|
||||||
@ -125,5 +149,10 @@ void ewol::Colored3DObject::DrawLine(etk::Vector<vec3>& vertices,
|
|||||||
// Request the draw od the elements :
|
// Request the draw od the elements :
|
||||||
ewol::openGL::DrawArrays(GL_LINES, 0, vertices.Size());
|
ewol::openGL::DrawArrays(GL_LINES, 0, vertices.Size());
|
||||||
m_GLprogram->UnUse();
|
m_GLprogram->UnUse();
|
||||||
|
if (true==depthtest) {
|
||||||
|
if (false==updateDepthBuffer) {
|
||||||
|
glDepthMask(GL_TRUE);
|
||||||
|
}
|
||||||
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
|
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
@ -30,13 +30,18 @@ namespace ewol
|
|||||||
virtual const char* GetType(void) { return "ewol::Colored3DObject"; };
|
virtual const char* GetType(void) { return "ewol::Colored3DObject"; };
|
||||||
virtual void Draw(etk::Vector<vec3>& vertices,
|
virtual void Draw(etk::Vector<vec3>& vertices,
|
||||||
const draw::Colorf& color,
|
const draw::Colorf& color,
|
||||||
bool updateDepthBuffer=true);
|
bool updateDepthBuffer=true,
|
||||||
|
bool depthtest=true);
|
||||||
virtual void Draw(etk::Vector<vec3>& vertices,
|
virtual void Draw(etk::Vector<vec3>& vertices,
|
||||||
const draw::Colorf& color,
|
const draw::Colorf& color,
|
||||||
mat4& transformationMatrix);
|
mat4& transformationMatrix,
|
||||||
|
bool updateDepthBuffer=true,
|
||||||
|
bool depthtest=true);
|
||||||
virtual void DrawLine(etk::Vector<vec3>& vertices,
|
virtual void DrawLine(etk::Vector<vec3>& vertices,
|
||||||
const draw::Colorf& color,
|
const draw::Colorf& color,
|
||||||
mat4& transformationMatrix);
|
mat4& transformationMatrix,
|
||||||
|
bool updateDepthBuffer=true,
|
||||||
|
bool depthtest=true);
|
||||||
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user