Mercurial > hg > orthanc-stone
comparison 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 |
comparison
equal
deleted
inserted
replaced
1204:b519c1c878f1 | 1205:6009c59d8676 |
---|---|
154 } | 154 } |
155 | 155 |
156 | 156 |
157 void SdlWindow::Render(SDL_Surface* surface) | 157 void SdlWindow::Render(SDL_Surface* surface) |
158 { | 158 { |
159 //SDL_RenderClear(renderer_); | 159 /** |
160 * "You are strongly encouraged to call SDL_RenderClear() to | |
161 * initialize the backbuffer before starting each new frame's | |
162 * drawing, even if you plan to overwrite every pixel." | |
163 * https://wiki.libsdl.org/SDL_RenderPresent | |
164 **/ | |
165 SDL_SetRenderDrawColor(renderer_, 0, 0, 0, 255); | |
166 SDL_RenderClear(renderer_); // Clear the entire screen to our selected color | |
160 | 167 |
161 SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer_, surface); | 168 SDL_Texture *texture = SDL_CreateTextureFromSurface(renderer_, surface); |
162 if (texture != NULL) | 169 if (texture != NULL) |
163 { | 170 { |
164 SDL_RenderCopy(renderer_, texture, NULL, NULL); | 171 SDL_RenderCopy(renderer_, texture, NULL, NULL); |