mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-04-23 08:29:09 +00:00
Add a new prepareToRender() callback for renders to perform their initial window clears
This consolidates all the clearing that was strewn across the codebase.
This commit is contained in:
@@ -54,6 +54,14 @@ bool SdlRenderer::prepareDecoderContext(AVCodecContext*, AVDictionary**)
|
||||
return true;
|
||||
}
|
||||
|
||||
void SdlRenderer::prepareToRender()
|
||||
{
|
||||
// Draw a black frame until the video stream starts rendering
|
||||
SDL_SetRenderDrawColor(m_Renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
|
||||
SDL_RenderClear(m_Renderer);
|
||||
SDL_RenderPresent(m_Renderer);
|
||||
}
|
||||
|
||||
bool SdlRenderer::isRenderThreadSupported()
|
||||
{
|
||||
SDL_RendererInfo info;
|
||||
@@ -165,13 +173,6 @@ bool SdlRenderer::initialize(PDECODER_PARAMETERS params)
|
||||
SDL_FlushEvent(SDL_WINDOWEVENT);
|
||||
}
|
||||
|
||||
if (!params->testOnly) {
|
||||
// Draw a black frame until the video stream starts rendering
|
||||
SDL_SetRenderDrawColor(m_Renderer, 0, 0, 0, SDL_ALPHA_OPAQUE);
|
||||
SDL_RenderClear(m_Renderer);
|
||||
SDL_RenderPresent(m_Renderer);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN32
|
||||
// For some reason, using Direct3D9Ex breaks this with multi-monitor setups.
|
||||
// When focus is lost, the window is minimized then immediately restored without
|
||||
|
||||
Reference in New Issue
Block a user