[DEBUG] correct OS request force redraw ==> it work now

This commit is contained in:
Edouard DUPIN 2017-04-28 00:57:21 +02:00
parent 5e65339d82
commit 4266dd1bfe
2 changed files with 11 additions and 6 deletions

View File

@ -633,6 +633,7 @@ bool gale::Context::OS_Draw(bool _displayEveryTime) {
}
gale::openGL::threadHasContext();
echrono::Steady currentTime = echrono::Steady::now();
// TODO : Review this ...
// this is to prevent the multiple display at the a high frequency ...
#if (!defined(__TARGET_OS__Android) && !defined(__TARGET_OS__Windows))
if(currentTime - m_previousDisplayTime < echrono::milliseconds(8)) {
@ -662,8 +663,6 @@ bool gale::Context::OS_Draw(bool _displayEveryTime) {
Release the event processing
*/
if (m_application != nullptr) {
// Redraw all needed elements
m_application->onRegenerateDisplay(*this);
@ -713,6 +712,7 @@ bool gale::Context::OS_Draw(bool _displayEveryTime) {
m_FpsFlush.tic();
}
if (hasDisplayDone == true) {
//GALE_INFO("lklklklklk " << _displayEveryTime);
if (m_displayFps == true) {
m_FpsFlush.incrementCounter();
}

View File

@ -799,12 +799,12 @@ class X11Interface : public gale::Context {
// break;
case MapNotify:
X11_INFO("X11 event : MapNotify");
specialEventThatNeedARedraw=true;
specialEventThatNeedARedraw = true;
OS_Show();
break;
case UnmapNotify:
X11_INFO("X11 event : UnmapNotify");
specialEventThatNeedARedraw=true;
specialEventThatNeedARedraw = true;
OS_Hide();
break;
default:
@ -822,11 +822,16 @@ class X11Interface : public gale::Context {
XSync(m_display,0);
}
// draw after switch the previous windows ...
//GALE_DEBUG("specialEventThatNeedARedraw"<<specialEventThatNeedARedraw);
if (specialEventThatNeedARedraw == true) {
X11_INFO("specialEventThatNeedARedraw = " << specialEventThatNeedARedraw);
}
hasDisplay = OS_Draw(specialEventThatNeedARedraw);
if (hasDisplay == true) {
// need to request it every time needed to have a redrawing (this can take some time if the application filter the drfaw periodicity)
specialEventThatNeedARedraw = false;
}
}
}
return 0;
}
/****************************************************************************************/