mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] egl: properly wait for a new frame on restart
This commit is contained in:
parent
74649ddb96
commit
da8b2d0cec
@ -68,6 +68,7 @@ struct Inst
|
|||||||
EGL_Alert * alert; // the alert display
|
EGL_Alert * alert; // the alert display
|
||||||
|
|
||||||
LG_RendererFormat format;
|
LG_RendererFormat format;
|
||||||
|
bool start;
|
||||||
uint64_t waitFadeTime;
|
uint64_t waitFadeTime;
|
||||||
bool waitDone;
|
bool waitDone;
|
||||||
|
|
||||||
@ -231,6 +232,7 @@ void egl_on_restart(void * opaque)
|
|||||||
|
|
||||||
eglDestroyContext(this->display, this->frameContext);
|
eglDestroyContext(this->display, this->frameContext);
|
||||||
this->frameContext = NULL;
|
this->frameContext = NULL;
|
||||||
|
this->start = false;
|
||||||
this->waitFadeTime = 0;
|
this->waitFadeTime = 0;
|
||||||
this->waitDone = false;
|
this->waitDone = false;
|
||||||
}
|
}
|
||||||
@ -350,6 +352,7 @@ bool egl_on_frame_event(void * opaque, const LG_RendererFormat format, const Fra
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->start = true;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -542,7 +545,10 @@ bool egl_render(void * opaque, SDL_Window * window)
|
|||||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
if (egl_desktop_render(this->desktop, this->translateX, this->translateY, this->scaleX, this->scaleY, this->useNearest))
|
if (this->start && egl_desktop_render(this->desktop,
|
||||||
|
this->translateX, this->translateY,
|
||||||
|
this->scaleX , this->scaleY ,
|
||||||
|
this->useNearest))
|
||||||
{
|
{
|
||||||
if (!this->waitFadeTime)
|
if (!this->waitFadeTime)
|
||||||
this->waitFadeTime = microtime() + SPLASH_FADE_TIME;
|
this->waitFadeTime = microtime() + SPLASH_FADE_TIME;
|
||||||
|
Loading…
Reference in New Issue
Block a user