From 9a84c63701a595ff1816f7065236b6841656107e Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Fri, 15 Mar 2013 07:35:05 +0100 Subject: [PATCH] [DEV] set text testing depth --- sources/ewol/compositing/Text.cpp | 10 +++++++--- sources/ewol/compositing/Text.h | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sources/ewol/compositing/Text.cpp b/sources/ewol/compositing/Text.cpp index e09b4f18..afb74a8f 100644 --- a/sources/ewol/compositing/Text.cpp +++ b/sources/ewol/compositing/Text.cpp @@ -98,7 +98,7 @@ void ewol::Text::LoadProgram(void) } } -void ewol::Text::Draw(const mat4& transformationMatrix) +void ewol::Text::Draw(const mat4& transformationMatrix, bool enableDepthTest) { // draw BG in any case: @@ -117,7 +117,9 @@ void ewol::Text::Draw(const mat4& transformationMatrix) EWOL_ERROR("No shader ..."); return; } - ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST); + if (true==enableDepthTest) { + ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST); + } // set Matrix : translation/positionMatrix mat4 projMatrix = ewol::openGL::GetMatrix(); mat4 camMatrix = ewol::openGL::GetCameraMatrix(); @@ -135,7 +137,9 @@ void ewol::Text::Draw(const mat4& transformationMatrix) // 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); + if (true==enableDepthTest) { + ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST); + } } diff --git a/sources/ewol/compositing/Text.h b/sources/ewol/compositing/Text.h index deaa7a3a..1f639f19 100644 --- a/sources/ewol/compositing/Text.h +++ b/sources/ewol/compositing/Text.h @@ -119,7 +119,7 @@ namespace ewol * @brief Draw All the refistered text in the current element on openGL */ void Draw(void); - void Draw(const mat4& transformationMatrix); + void Draw(const mat4& transformationMatrix, bool enableDepthTest=false); /** * @brief Clear all the registered element in the current element */