[DEV] display optimesation next step done

This commit is contained in:
Edouard DUPIN 2013-03-13 21:29:51 +01:00
parent 75df3e4b8b
commit c870d2471e
9 changed files with 220 additions and 56 deletions

View File

@ -12,7 +12,8 @@
etk::Vector<mat4> l_matrixList;
mat4 l_matrixCamera;
static uint32_t l_flags = 0;
static uint32_t l_flagsCurrent = 0;
static uint32_t l_flagsMustBeSet = 0;
static uint32_t l_textureflags = 0;
static int32_t l_programId = 0;
@ -23,7 +24,8 @@ void ewol::openGL::Init(void)
mat4 tmpMat;
l_matrixList.PushBack(tmpMat);
l_matrixCamera.Identity();
l_flags = 0;
l_flagsCurrent = 0;
l_flagsMustBeSet = 0;
l_textureflags = 0;
l_programId = -1;
}
@ -118,16 +120,120 @@ void ewol::openGL::Swap(void)
}
void ewol::openGL::Enable(uint32_t flagID)
//#define DIRECT_MODE
typedef struct {
uint32_t curentFlag;
GLenum OGlFlag;
} correspondenceTable_ts;
static correspondenceTable_ts basicFlag[] = {
{(uint32_t)ewol::openGL::FLAG_BLEND, GL_BLEND},
#ifndef __TARGET_OS__Android
{(uint32_t)ewol::openGL::FLAG_CLIP_DISTANCE_I, GL_CLIP_DISTANCE0},
{(uint32_t)ewol::openGL::FLAG_COLOR_LOGIC_OP, GL_COLOR_LOGIC_OP},
#endif
{(uint32_t)ewol::openGL::FLAG_CULL_FACE, GL_CULL_FACE},
#ifndef __TARGET_OS__Android
{(uint32_t)ewol::openGL::FLAG_DEBUG_OUTPUT, GL_DEBUG_OUTPUT},
{(uint32_t)ewol::openGL::FLAG_DEBUG_OUTPUT_SYNCHRONOUS, GL_DEBUG_OUTPUT_SYNCHRONOUS},
{(uint32_t)ewol::openGL::FLAG_DEPTH_CLAMP, GL_DEPTH_CLAMP},
#endif
{(uint32_t)ewol::openGL::FLAG_DEPTH_TEST, GL_DEPTH_TEST},
{(uint32_t)ewol::openGL::FLAG_DITHER, GL_DITHER},
#ifndef __TARGET_OS__Android
{(uint32_t)ewol::openGL::FLAG_FRAMEBUFFER_SRGB, GL_FRAMEBUFFER_SRGB},
{(uint32_t)ewol::openGL::FLAG_LINE_SMOOTH, GL_LINE_SMOOTH},
{(uint32_t)ewol::openGL::FLAG_MULTISAMPLE, GL_MULTISAMPLE},
#endif
{(uint32_t)ewol::openGL::FLAG_POLYGON_OFFSET_FILL, GL_POLYGON_OFFSET_FILL},
#ifndef __TARGET_OS__Android
{(uint32_t)ewol::openGL::FLAG_POLYGON_OFFSET_LINE, GL_POLYGON_OFFSET_LINE},
{(uint32_t)ewol::openGL::FLAG_POLYGON_OFFSET_POINT, GL_POLYGON_OFFSET_POINT},
{(uint32_t)ewol::openGL::FLAG_POLYGON_SMOOTH, GL_POLYGON_SMOOTH},
{(uint32_t)ewol::openGL::FLAG_PRIMITIVE_RESTART, GL_PRIMITIVE_RESTART},
{(uint32_t)ewol::openGL::FLAG_PRIMITIVE_RESTART_FIXED_INDEX, GL_PRIMITIVE_RESTART_FIXED_INDEX},
#endif
{(uint32_t)ewol::openGL::FLAG_SAMPLE_ALPHA_TO_COVERAGE, GL_SAMPLE_ALPHA_TO_COVERAGE},
#ifndef __TARGET_OS__Android
{(uint32_t)ewol::openGL::FLAG_SAMPLE_ALPHA_TO_ONE, GL_SAMPLE_ALPHA_TO_ONE},
#endif
{(uint32_t)ewol::openGL::FLAG_SAMPLE_COVERAGE, GL_SAMPLE_COVERAGE},
#ifndef __TARGET_OS__Android
{(uint32_t)ewol::openGL::FLAG_SAMPLE_SHADING, GL_SAMPLE_SHADING},
{(uint32_t)ewol::openGL::FLAG_SAMPLE_MASK, GL_SAMPLE_MASK},
#endif
{(uint32_t)ewol::openGL::FLAG_SCISSOR_TEST, GL_SCISSOR_TEST},
{(uint32_t)ewol::openGL::FLAG_STENCIL_TEST, GL_STENCIL_TEST},
#ifndef __TARGET_OS__Android
{(uint32_t)ewol::openGL::FLAG_PROGRAM_POINT_SIZE, GL_PROGRAM_POINT_SIZE},
#endif
{(uint32_t)ewol::openGL::FLAG_TEXTURE_2D, GL_TEXTURE_2D},
#ifndef __TARGET_OS__Android
{(uint32_t)ewol::openGL::FLAG_ALPHA_TEST, GL_ALPHA_TEST},
{(uint32_t)ewol::openGL::FLAG_FOG, GL_FOG}
#endif
//{(uint32_t)ewol::openGL::FLAG_, GL_}
};
static int32_t basicFlagCount = sizeof(basicFlag) / sizeof(correspondenceTable_ts);
void ewol::openGL::Enable(ewol::openGL::openGlFlags_te flagID)
{
glEnable(flagID);
#ifdef DIRECT_MODE
for (int32_t iii=0; iii<basicFlagCount ; iii++) {
if ( basicFlag[iii].curentFlag==(uint32_t)flagID ) {
glEnable(basicFlag[iii].OGlFlag);
}
}
# else
//EWOL_DEBUG("Enable FLAGS = " << l_flagsMustBeSet);
l_flagsMustBeSet |= (uint32_t)flagID;
//EWOL_DEBUG(" ==>" << l_flagsMustBeSet);
#endif
}
void ewol::openGL::Disable(uint32_t flagID)
void ewol::openGL::Disable(ewol::openGL::openGlFlags_te flagID)
{
glDisable(flagID);
#ifdef DIRECT_MODE
for (int32_t iii=0; iii<basicFlagCount ; iii++) {
if ( basicFlag[iii].curentFlag==(uint32_t)flagID ) {
glDisable(basicFlag[iii].OGlFlag);
}
}
# else
//EWOL_DEBUG("Disable FLAGS = " << l_flagsMustBeSet);
l_flagsMustBeSet &= ~((uint32_t)flagID);
//EWOL_DEBUG(" ==>" << l_flagsMustBeSet);
#endif
}
void ewol::openGL::UpdateAllFlags(void)
{
#ifdef DIRECT_MODE
return;
#endif
// check if fhags has change :
if (l_flagsMustBeSet==l_flagsCurrent ) {
return;
}
//EWOL_DEBUG(" ==>" << l_flagsMustBeSet);
for (int32_t iii=0; iii<basicFlagCount ; iii++) {
uint32_t CurrentFlag = basicFlag[iii].curentFlag;
if ( (l_flagsMustBeSet&CurrentFlag)!=(l_flagsCurrent&CurrentFlag) ) {
if ( (l_flagsMustBeSet&CurrentFlag) != 0) {
glEnable(basicFlag[iii].OGlFlag);
} else {
glDisable(basicFlag[iii].OGlFlag);
}
}
}
l_flagsCurrent = l_flagsMustBeSet;
}
void ewol::openGL::ActiveTexture(uint32_t flagID)
{
glActiveTexture(flagID);
@ -140,23 +246,16 @@ void ewol::openGL::DesActiveTexture(uint32_t flagID)
void ewol::openGL::DrawArrays(uint32_t mode, int32_t first, int32_t count)
{
UpdateAllFlags();
glDrawArrays(mode, first, count);
}
void ewol::openGL::DrawArraysInstanced(uint32_t mode, int32_t first, int32_t count, int32_t primcount)
{
glDrawArraysInstanced(mode, first, count, primcount);
}
void ewol::openGL::DrawElements(uint32_t mode, int32_t count, uint32_t type, const void* indices)
{
UpdateAllFlags();
glDrawElements(mode, count, type, indices);
}
void ewol::openGL::DrawRangeElements(uint32_t mode, int32_t start, int32_t end, int32_t count, uint32_t type, const void* indices)
{
glDrawRangeElements(mode, start, end, count, type, indices);
}
void ewol::openGL::UseProgram(int32_t id)
{

View File

@ -105,16 +105,53 @@ namespace ewol {
* @brief
*/
void Swap(void);
typedef enum {
FLAG_BLEND = 1<<0, //!< If enabled, blend the computed fragment color values with the values in the color buffers. See glBlendFunc.
FLAG_CLIP_DISTANCE_I = 1<<1, //!< If enabled, clip geometry against user-defined half space i.
FLAG_COLOR_LOGIC_OP = 1<<2, //!< If enabled, apply the currently selected logical operation to the computed fragment color and color buffer values. See glLogicOp.
FLAG_CULL_FACE = 1<<3, //!< If enabled, cull polygons based on their winding in window coordinates. See glCullFace.
FLAG_DEBUG_OUTPUT = 1<<4, //!< If enabled, debug messages are produced by a debug context. When disabled, the debug message log is silenced. Note that in a non-debug context, very few, if any messages might be produced, even when GL_DEBUG_OUTPUT is enabled.
FLAG_DEBUG_OUTPUT_SYNCHRONOUS = 1<<5, //!< If enabled, debug messages are produced synchronously by a debug context. If disabled, debug messages may be produced asynchronously. In particular, they may be delayed relative to the execution of GL commands, and the debug callback function may be called from a thread other than that in which the commands are executed. See glDebugMessageCallback.
FLAG_DEPTH_CLAMP = 1<<6, //!< If enabled, the -wc≤zc≤wc plane equation is ignored by view volume clipping (effectively, there is no near or far plane clipping). See glDepthRange.
FLAG_DEPTH_TEST = 1<<7, //!< If enabled, do depth comparisons and update the depth buffer. Note that even if the depth buffer exists and the depth mask is non-zero, the depth buffer is not updated if the depth test is disabled. See glDepthFunc and glDepthRange.
FLAG_DITHER = 1<<8, //!< If enabled, dither color components or indices before they are written to the color buffer.
FLAG_FRAMEBUFFER_SRGB = 1<<9, //!< If enabled and the value of GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING for the framebuffer attachment corresponding to the destination buffer is GL_SRGB, the R, G, and B destination color values (after conversion from fixed-point to floating-point) are considered to be encoded for the sRGB color space and hence are linearized prior to their use in blending.
FLAG_LINE_SMOOTH = 1<<10, //!< If enabled, draw lines with correct filtering. Otherwise, draw aliased lines. See glLineWidth.
FLAG_MULTISAMPLE = 1<<11, //!< If enabled, use multiple fragment samples in computing the final color of a pixel. See glSampleCoverage.
FLAG_POLYGON_OFFSET_FILL = 1<<12, //!< If enabled, and if the polygon is rendered in GL_FILL mode, an offset is added to depth values of a polygon's fragments before the depth comparison is performed. See glPolygonOffset.
FLAG_POLYGON_OFFSET_LINE = 1<<13, //!< If enabled, and if the polygon is rendered in GL_LINE mode, an offset is added to depth values of a polygon's fragments before the depth comparison is performed. See glPolygonOffset.
FLAG_POLYGON_OFFSET_POINT = 1<<14, //!< If enabled, an offset is added to depth values of a polygon's fragments before the depth comparison is performed, if the polygon is rendered in GL_POINT mode. See glPolygonOffset.
FLAG_POLYGON_SMOOTH = 1<<15, //!< If enabled, draw polygons with proper filtering. Otherwise, draw aliased polygons. For correct antialiased polygons, an alpha buffer is needed and the polygons must be sorted front to back.
FLAG_PRIMITIVE_RESTART = 1<<16, //!< Enables primitive restarting. If enabled, any one of the draw commands which transfers a set of generic attribute array elements to the GL will restart the primitive when the index of the vertex is equal to the primitive restart index. See glPrimitiveRestartIndex.
FLAG_PRIMITIVE_RESTART_FIXED_INDEX = 1<<17, //!< Enables primitive restarting with a fixed index. If enabled, any one of the draw commands which transfers a set of generic attribute array elements to the GL will restart the primitive when the index of the vertex is equal to the fixed primitive index for the specified index type. The fixed index is equal to 2n1 where n is equal to 8 for GL_UNSIGNED_BYTE, 16 for GL_UNSIGNED_SHORT and 32 for GL_UNSIGNED_INT.
FLAG_SAMPLE_ALPHA_TO_COVERAGE = 1<<18, //!< If enabled, compute a temporary coverage value where each bit is determined by the alpha value at the corresponding sample location. The temporary coverage value is then ANDed with the fragment coverage value.
FLAG_SAMPLE_ALPHA_TO_ONE = 1<<19, //!< If enabled, each sample alpha value is replaced by the maximum representable alpha value.
FLAG_SAMPLE_COVERAGE = 1<<20, //!< If enabled, the fragment's coverage is ANDed with the temporary coverage value. If GL_SAMPLE_COVERAGE_INVERT is set to GL_TRUE, invert the coverage value. See glSampleCoverage.
FLAG_SAMPLE_SHADING = 1<<21, //!< If enabled, the active fragment shader is run once for each covered sample, or at fraction of this rate as determined by the current value of GL_MIN_SAMPLE_SHADING_VALUE. See glMinSampleShading.
FLAG_SAMPLE_MASK = 1<<22, //!< If enabled, the sample coverage mask generated for a fragment during rasterization will be ANDed with the value of GL_SAMPLE_MASK_VALUE before shading occurs. See glSampleMaski.
FLAG_SCISSOR_TEST = 1<<23, //!< If enabled, discard fragments that are outside the scissor rectangle. See glScissor.
FLAG_STENCIL_TEST = 1<<24, //!< If enabled, do stencil testing and update the stencil buffer. See glStencilFunc and glStencilOp. GL_TEXTURE_CUBE_MAP_SEAMLESS = 1<<0, //!< If enabled, cubemap textures are sampled such that when linearly sampling from the border between two adjacent faces, texels from both faces are used to generate the final sample value. When disabled, texels from only a single face are used to construct the final sample value.
FLAG_PROGRAM_POINT_SIZE = 1<<25, //!< If enabled and a vertex or geometry shader is active, then the derived point size is taken from the (potentially clipped) shader builtin gl_PointSize and clamped to the implementation-dependent point size range.
FLAG_TEXTURE_2D = 1<<26, //!<
FLAG_ALPHA_TEST = 1<<27, //!<
FLAG_FOG = 1<<28, //!<
} openGlFlags_te;
/**
* @brief Enable a flag on the system
* @param[in] flagID The flag requested
*/
void Enable(uint32_t flagID);
void Enable(openGlFlags_te flagID);
/**
* @brief Disable a flag on the system
* @param[in] flagID The flag requested
*/
void Disable(uint32_t flagID);
void Disable(openGlFlags_te flagID);
/**
* @brieg Update all the internal flag needed to be set from tre previous element set ...
*/
void UpdateAllFlags(void);
/**
* @brief Enable Texture on the system
* @param[in] flagID The flag requested
@ -129,9 +166,7 @@ namespace ewol {
* @brief draw a specific array ==> this enable mode difference ...
*/
void DrawArrays(uint32_t mode, int32_t first, int32_t count);
void DrawArraysInstanced(uint32_t mode, int32_t first, int32_t count, int32_t primcount);
void DrawElements(uint32_t mode, int32_t count, uint32_t type, const void* indices);
void DrawRangeElements(uint32_t mode, int32_t start, int32_t end, int32_t count, uint32_t type, const void* indices);
/**
* @brief Use openGL program
* @param[in] id Id of the program that might be used

View File

@ -467,10 +467,12 @@ bool eSystem::Draw(bool displayEveryTime)
{
int64_t currentTime = ewol::GetTime();
// this is to prevent the multiple display at the a high frequency ...
#ifndef __PLATFORM__Android
if(currentTime - previousDisplayTime < 1000000/120) {
usleep(1000);
return false;
}
#endif
previousDisplayTime = currentTime;
if (true == isGlobalSystemInit) {
@ -511,9 +513,11 @@ l_FpsSystem.IncrementCounter();
}
}
l_FpsSystem.Toc();
l_FpsFlush.Tic();
l_FpsFlush.IncrementCounter();
glFlush();
//glFinish();
l_FpsFlush.Toc();
l_FpsSystemEvent.Draw();

View File

@ -43,7 +43,7 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
EWOL_ERROR("No shader ...");
return;
}
ewol::openGL::Enable(GL_DEPTH_TEST);
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
if (false==updateDepthBuffer) {
glDepthMask(GL_FALSE);
}
@ -67,7 +67,7 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
if (false==updateDepthBuffer) {
glDepthMask(GL_TRUE);
}
ewol::openGL::Disable(GL_DEPTH_TEST);
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
}
void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
@ -81,7 +81,7 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
EWOL_ERROR("No shader ...");
return;
}
ewol::openGL::Enable(GL_DEPTH_TEST);
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
m_GLprogram->Use();
// set Matrix : translation/positionMatrix
@ -96,7 +96,7 @@ void ewol::Colored3DObject::Draw(etk::Vector<vec3>& vertices,
// Request the draw od the elements :
ewol::openGL::DrawArrays(GL_TRIANGLES, 0, vertices.Size());
m_GLprogram->UnUse();
ewol::openGL::Disable(GL_DEPTH_TEST);
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
}
void ewol::Colored3DObject::DrawLine(etk::Vector<vec3>& vertices,
@ -110,7 +110,7 @@ void ewol::Colored3DObject::DrawLine(etk::Vector<vec3>& vertices,
EWOL_ERROR("No shader ...");
return;
}
ewol::openGL::Enable(GL_DEPTH_TEST);
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
m_GLprogram->Use();
// set Matrix : translation/positionMatrix
@ -125,5 +125,5 @@ void ewol::Colored3DObject::DrawLine(etk::Vector<vec3>& vertices,
// Request the draw od the elements :
ewol::openGL::DrawArrays(GL_LINES, 0, vertices.Size());
m_GLprogram->UnUse();
ewol::openGL::Disable(GL_DEPTH_TEST);
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
}

View File

@ -121,7 +121,7 @@ void ewol::Mesh::Draw(mat4& positionMatrix)
EWOL_ERROR("No shader ...");
return;
}
ewol::openGL::Enable(GL_DEPTH_TEST);
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
//EWOL_DEBUG(" Display " << m_coord.Size() << " elements" );
m_GLprogram->Use();
// set Matrix : translation/positionMatrix
@ -147,8 +147,9 @@ void ewol::Mesh::Draw(mat4& positionMatrix)
// Request the draw od the elements :
ewol::openGL::DrawArrays(GL_TRIANGLES, 0, m_numberOfElments);
m_GLprogram->UnUse();
ewol::openGL::Disable(GL_DEPTH_TEST);
//glBindBuffer(GL_ARRAY_BUFFER,0);
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
// TODO : UNDERSTAND why ... it is needed
glBindBuffer(GL_ARRAY_BUFFER,0);
}
// normal calculation of the normal face is really easy :

View File

@ -666,7 +666,7 @@ void ewol::Program::Uniform4iv(int32_t idElem, int32_t nbElement, const int32_t
//checkGlError("glUniform4iv", __LINE__);
}
//#define PROGRAM_DISPLAY_SPEED
//////////////////////////////////////////////////////////////////////////////////////////////
#ifdef PROGRAM_DISPLAY_SPEED

View File

@ -906,26 +906,26 @@ void widget::Scene::OnDraw(ewol::DrawProperty& displayProp)
glLightfv(GL_LIGHT1, GL_SPECULAR, light_specular);
glLightfv(GL_LIGHT1, GL_POSITION, light_position1);
ewol::openGL::Enable(GL_LIGHTING);
ewol::openGL::Enable(GL_LIGHT0);
ewol::openGL::Enable(GL_LIGHT1);
ewol::openGL::Enable(ewol::openGL::FLAG_LIGHTING);
ewol::openGL::Enable(ewol::openGL::FLAG_LIGHT0);
ewol::openGL::Enable(ewol::openGL::FLAG_LIGHT1);
glShadeModel(GL_SMOOTH);
ewol::openGL::Enable(GL_DEPTH_TEST);
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
glDepthFunc(GL_LESS);
*/
//updateCamera();
if(false/*m_enableshadows*/) {
/*
glClear(GL_STENCIL_BUFFER_BIT);
ewol::openGL::Enable(GL_CULL_FACE);
ewol::openGL::Enable(ewol::openGL::FLAG_CULL_FACE);
renderscene(0);
ewol::openGL::Disable(GL_LIGHTING);
ewol::openGL::Disable(ewol::openGL::FLAG_LIGHTING);
glDepthMask(GL_FALSE);
glDepthFunc(GL_LEQUAL);
ewol::openGL::Enable(GL_STENCIL_TEST);
ewol::openGL::Enable(ewol::openGL::FLAG_STENCIL_TEST);
glColorMask(GL_FALSE,GL_FALSE,GL_FALSE,GL_FALSE);
glStencilFunc(GL_ALWAYS,1,0xFFFFFFFFL);
glFrontFace(GL_CCW);
@ -939,34 +939,34 @@ void widget::Scene::OnDraw(ewol::DrawProperty& displayProp)
glPolygonMode(GL_FRONT,GL_FILL);
glPolygonMode(GL_BACK,GL_FILL);
glShadeModel(GL_SMOOTH);
ewol::openGL::Enable(GL_DEPTH_TEST);
ewol::openGL::Enable(ewol::openGL::FLAG_DEPTH_TEST);
glDepthFunc(GL_LESS);
ewol::openGL::Enable(GL_LIGHTING);
ewol::openGL::Enable(ewol::openGL::FLAG_LIGHTING);
glDepthMask(GL_TRUE);
glCullFace(GL_BACK);
glFrontFace(GL_CCW);
ewol::openGL::Enable(GL_CULL_FACE);
ewol::openGL::Enable(ewol::openGL::FLAG_CULL_FACE);
glColorMask(GL_TRUE,GL_TRUE,GL_TRUE,GL_TRUE);
glDepthFunc(GL_LEQUAL);
glStencilFunc( GL_NOTEQUAL, 0, 0xFFFFFFFFL );
glStencilOp( GL_KEEP, GL_KEEP, GL_KEEP );
ewol::openGL::Disable(GL_LIGHTING);
ewol::openGL::Disable(ewol::openGL::FLAG_LIGHTING);
renderscene(2);
ewol::openGL::Enable(GL_LIGHTING);
ewol::openGL::Enable(ewol::openGL::FLAG_LIGHTING);
glDepthFunc(GL_LESS);
ewol::openGL::Disable(GL_STENCIL_TEST);
ewol::openGL::Disable(GL_CULL_FACE);
ewol::openGL::Disable(ewol::openGL::FLAG_STENCIL_TEST);
ewol::openGL::Disable(ewol::openGL::FLAG_CULL_FACE);
*/
} else {
//ewol::openGL::Disable(GL_CULL_FACE);
//ewol::openGL::Disable(ewol::openGL::FLAG_CULL_FACE);
renderscene(0);
}
/*
int32_t xOffset = 10;
int32_t yStart = 20;
int32_t yIncr = 20;
ewol::openGL::Disable(GL_LIGHTING);
ewol::openGL::Disable(ewol::openGL::FLAG_LIGHTING);
glColor3f(0, 0, 0);
if ((m_debugMode & btIDebugDraw::DBG_NoHelpText)==0) {
@ -974,7 +974,7 @@ void widget::Scene::OnDraw(ewol::DrawProperty& displayProp)
showProfileInfo(xOffset,yStart,yIncr);
resetPerspectiveProjection();
}
ewol::openGL::Disable(GL_LIGHTING);
ewol::openGL::Disable(ewol::openGL::FLAG_LIGHTING);
*/
//updateCamera();

View File

@ -150,7 +150,10 @@ void ewol::Widget::GenDraw(DrawProperty displayProp)
// Call the widget drawing methode
displayProp.m_origin.setValue(tmpOriginX, tmpOriginY);
displayProp.m_size.setValue(tmpclipX, m_size.y());
//int64_t ___startTime = ewol::GetTime();
OnDraw(displayProp);
//float ___localTime = (float)(ewol::GetTime() - ___startTime) / 1000.0f;
//EWOL_DEBUG(" Widget1 : " << ___localTime << "ms ");
} else {
glViewport( m_origin.x(),
m_origin.y(),
@ -165,7 +168,10 @@ void ewol::Widget::GenDraw(DrawProperty displayProp)
// Call the widget drawing methode
displayProp.m_origin = m_origin;
displayProp.m_size = m_size;
//int64_t ___startTime = ewol::GetTime();
OnDraw(displayProp);
//float ___localTime = (float)(ewol::GetTime() - ___startTime) / 1000.0f;
//EWOL_DEBUG(" Widget2 : " << ___localTime << "ms ");
}
ewol::openGL::Pop();
return;

View File

@ -97,18 +97,18 @@ void ewol::Windows::SysDraw(void)
// set the size of the open GL system
glViewport(0,0,m_size.x(),m_size.y());
ewol::openGL::Disable(GL_DITHER);
//ewol::openGL::Disable(GL_BLEND);
ewol::openGL::Disable(GL_STENCIL_TEST);
ewol::openGL::Disable(ewol::openGL::FLAG_DITHER);
//ewol::openGL::Disable(ewol::openGL::FLAG_BLEND);
ewol::openGL::Disable(ewol::openGL::FLAG_STENCIL_TEST);
ewol::openGL::Disable(ewol::openGL::FLAG_ALPHA_TEST);
ewol::openGL::Disable(ewol::openGL::FLAG_FOG);
#ifndef __TARGET_OS__Android
ewol::openGL::Disable(GL_ALPHA_TEST);
ewol::openGL::Disable(GL_FOG);
glPixelZoom(1.0,1.0);
#endif
ewol::openGL::Disable(GL_TEXTURE_2D);
ewol::openGL::Disable(GL_DEPTH_TEST);
ewol::openGL::Disable(ewol::openGL::FLAG_TEXTURE_2D);
ewol::openGL::Disable(ewol::openGL::FLAG_DEPTH_TEST);
ewol::openGL::Enable(GL_BLEND);
ewol::openGL::Enable(ewol::openGL::FLAG_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// clear the matrix system :
@ -122,7 +122,7 @@ void ewol::Windows::SysDraw(void)
GenDraw(displayProp);
ewol::openGL::Disable(GL_BLEND);
ewol::openGL::Disable(ewol::openGL::FLAG_BLEND);
return;
}
@ -138,20 +138,35 @@ void ewol::Windows::OnRegenerateDisplay(void)
}
}
//#define TEST_PERFO_WINDOWS
void ewol::Windows::OnDraw(ewol::DrawProperty& displayProp)
{
#ifdef TEST_PERFO_WINDOWS
int64_t ___startTime0 = ewol::GetTime();
#endif
// Clear the screen with transparency ...
glClearColor(0.750, 0.750, 0.750, 0.5);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
#ifdef TEST_PERFO_WINDOWS
float ___localTime0 = (float)(ewol::GetTime() - ___startTime0) / 1000.0f;
EWOL_ERROR(" Windows000 : " << ___localTime0 << "ms ");
int64_t ___startTime1 = ewol::GetTime();
#endif
//EWOL_WARNING(" WINDOWS draw on " << m_currentDrawId);
// first display the windows on the display
if (NULL != m_subWidget) {
m_subWidget->GenDraw(displayProp);
//EWOL_DEBUG("Draw Windows");
}
#ifdef TEST_PERFO_WINDOWS
float ___localTime1 = (float)(ewol::GetTime() - ___startTime1) / 1000.0f;
EWOL_ERROR(" Windows111 : " << ___localTime1 << "ms ");
int64_t ___startTime2 = ewol::GetTime();
#endif
// second display the pop-up
for(int32_t iii=0; iii<m_popUpWidgetList.Size(); iii++) {
if (NULL != m_popUpWidgetList[iii]) {
@ -159,6 +174,10 @@ void ewol::Windows::OnDraw(ewol::DrawProperty& displayProp)
//EWOL_DEBUG("Draw Pop-up");
}
}
#ifdef TEST_PERFO_WINDOWS
float ___localTime2 = (float)(ewol::GetTime() - ___startTime2) / 1000.0f;
EWOL_ERROR(" Windows222 : " << ___localTime2 << "ms ");
#endif
}