try to remove some "flickering" by using setActive(false)/setActive() and adding

a glFlush...
This commit is contained in:
ALONSO Laurent
2022-07-13 14:00:17 +02:00
committed by Celtic Minstrel
parent ba435bdfd3
commit f2584f4133
7 changed files with 40 additions and 17 deletions

View File

@@ -1026,7 +1026,7 @@ xBadVal::~xBadVal() throw(){
bool cDialog::doAnimations = false;
void cDialog::draw(){
win.setActive();
win.setActive(false);
tileImage(win,winRect,::bg[bg]);
if(doAnimations && animTimer.getElapsedTime().asMilliseconds() >= 500) {
cPict::advanceAnim();
@@ -1039,6 +1039,7 @@ void cDialog::draw(){
iter++;
}
win.setActive();
win.display();
}

View File

@@ -51,7 +51,7 @@ bool cButton::isScrollable(){
void cButton::draw(){
rectangle from_rect, to_rect;
inWindow->setActive();
inWindow->setActive(false);
if(visible){
TextStyle style;
@@ -86,6 +86,7 @@ void cButton::draw(){
// frame default button, to provide a visual cue that it's the default
if(key.spec && key.k == key_enter) drawFrame(2,frameStyle);
}
inWindow->setActive();
}
bool cButton::manageFormat(eFormat prop, bool set, boost::any* val) {

View File

@@ -89,7 +89,7 @@ bool cLed::manageFormat(eFormat prop, bool set, boost::any* val) {
void cLed::draw(){
rectangle from_rect, to_rect;
inWindow->setActive();
inWindow->setActive(false);
if(visible){
TextStyle style;
@@ -106,6 +106,8 @@ void cLed::draw(){
to_rect.left = frame.left + 18; // Possibly could be 20
win_draw_string(*inWindow,to_rect,lbl,wrapLabel ? eTextMode::WRAP : eTextMode::LEFT_TOP,style);
}
inWindow->setActive();
}
cControl::storage_t cLed::store() {