diff options
author | Tuomas Virtanen <katajakasa@gmail.com> | 2018-07-04 00:31:58 +0300 |
---|---|---|
committer | Tuomas Virtanen <katajakasa@gmail.com> | 2018-07-04 00:31:58 +0300 |
commit | 327e18f48bdb54552053ff4b54a5b5da91afc8c8 (patch) | |
tree | 6b366e6818fb9cf0f9e8f1163a3069b71cc1c8f2 | |
parent | c9534076646cda63bdc9a94ce02067c4651926e3 (diff) |
Move screen clearing outside the main loop in examples
-rw-r--r-- | examples/example_complex.c | 8 | ||||
-rw-r--r-- | examples/example_custom.c | 8 | ||||
-rw-r--r-- | examples/example_rwops.c | 8 | ||||
-rw-r--r-- | examples/example_simple.c | 8 |
4 files changed, 16 insertions, 16 deletions
diff --git a/examples/example_complex.c b/examples/example_complex.c index 5bd0b19..b8dc6ee 100644 --- a/examples/example_complex.c +++ b/examples/example_complex.c @@ -224,6 +224,10 @@ int main(int argc, char *argv[]) { // Make sure subtitle texture is in correct blendmode SDL_SetTextureBlendMode(subtitle_tex, SDL_BLENDMODE_BLEND); + // Clear screen with black + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); + // Start playback Kit_PlayerPlay(player); @@ -340,10 +344,6 @@ int main(int argc, char *argv[]) { } } - // Clear screen with black - SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); - SDL_RenderClear(renderer); - // Refresh videotexture and render it Kit_GetPlayerVideoData(player, video_tex); SDL_RenderCopy(renderer, video_tex, NULL, NULL); diff --git a/examples/example_custom.c b/examples/example_custom.c index e365850..f99c94e 100644 --- a/examples/example_custom.c +++ b/examples/example_custom.c @@ -141,6 +141,10 @@ int main(int argc, char *argv[]) { // Make sure subtitle texture is in correct blendmode SDL_SetTextureBlendMode(subtitle_tex, SDL_BLENDMODE_BLEND); + // Clear screen with black + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); + // Start playback Kit_PlayerPlay(player); @@ -195,10 +199,6 @@ int main(int argc, char *argv[]) { } } - // Clear screen with black - SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); - SDL_RenderClear(renderer); - // Refresh videotexture and render it Kit_GetPlayerVideoData(player, video_tex); SDL_RenderCopy(renderer, video_tex, NULL, NULL); diff --git a/examples/example_rwops.c b/examples/example_rwops.c index 418f7a7..84370f1 100644 --- a/examples/example_rwops.c +++ b/examples/example_rwops.c @@ -133,6 +133,10 @@ int main(int argc, char *argv[]) { // Make sure subtitle texture is in correct blendmode SDL_SetTextureBlendMode(subtitle_tex, SDL_BLENDMODE_BLEND); + // Clear screen with black + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); + // Start playback Kit_PlayerPlay(player); @@ -188,10 +192,6 @@ int main(int argc, char *argv[]) { } } - // Clear screen with black - SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); - SDL_RenderClear(renderer); - // Refresh videotexture and render it Kit_GetPlayerVideoData(player, video_tex); SDL_RenderCopy(renderer, video_tex, NULL, NULL); diff --git a/examples/example_simple.c b/examples/example_simple.c index a7dbbfd..4c581c0 100644 --- a/examples/example_simple.c +++ b/examples/example_simple.c @@ -126,6 +126,10 @@ int main(int argc, char *argv[]) { // Make sure subtitle texture is in correct blendmode SDL_SetTextureBlendMode(subtitle_tex, SDL_BLENDMODE_BLEND); + // Clear screen with black + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); + // Start playback Kit_PlayerPlay(player); @@ -174,10 +178,6 @@ int main(int argc, char *argv[]) { } } - // Clear screen with black - SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); - SDL_RenderClear(renderer); - // Refresh videotexture and render it Kit_GetPlayerVideoData(player, video_tex); SDL_RenderCopy(renderer, video_tex, NULL, NULL); |