Mercurial > hg > orthanc-stone
diff Framework/Viewport/SdlWindow.cpp @ 1205:6009c59d8676 broker
fix to sdl
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 02 Dec 2019 14:32:05 +0100 |
parents | 4cc997207d8a |
children | 0ca50d275b9a |
line wrap: on
line diff
--- a/Framework/Viewport/SdlWindow.cpp Fri Nov 29 21:24:29 2019 +0100 +++ b/Framework/Viewport/SdlWindow.cpp Mon Dec 02 14:32:05 2019 +0100 @@ -156,7 +156,14 @@ void SdlWindow::Render(SDL_Surface* surface) { - //SDL_RenderClear(renderer_); + /** + * "You are strongly encouraged to call SDL_RenderClear() to + * initialize the backbuffer before starting each new frame's + * drawing, even if you plan to overwrite every pixel." + * https://wiki.libsdl.org/SDL_RenderPresent + **/ + SDL_SetRenderDrawColor(renderer_, 0, 0, 0, 255); + SDL_RenderClear(renderer_); // Clear the entire screen to our selected color SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer_, surface); if (texture != NULL)