From 84cdd9347038f2dd4b814242440eeebfa3705cd8 Mon Sep 17 00:00:00 2001 From: Gabriel Wang Date: Sat, 28 Dec 2024 07:23:14 +0000 Subject: [PATCH] Update Virtual_TFT_Port.c --- .../platform/Virtual_TFT_Port.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/examples/[template][pc][vscode]/platform/Virtual_TFT_Port.c b/examples/[template][pc][vscode]/platform/Virtual_TFT_Port.c index c4bce15c..b64b07ee 100644 --- a/examples/[template][pc][vscode]/platform/Virtual_TFT_Port.c +++ b/examples/[template][pc][vscode]/platform/Virtual_TFT_Port.c @@ -233,16 +233,7 @@ void VT_sdl_refresh_task(void) static void *s_pLastFB = NULL; VT_Fill_Multiple_Colors(0, 0, VT_WIDTH - 1, VT_HEIGHT - 1, (color_typedef *)pFrameBuffer); - #endif - SDL_UpdateTexture(texture, NULL, tft_fb, VT_WIDTH * sizeof(uint32_t)); - SDL_RenderClear(renderer); - - /*Update the renderer with the texture containing the rendered image*/ - SDL_RenderCopy(renderer, texture, NULL, NULL); - SDL_RenderPresent(renderer); - - #if __DISP0_CFG_ENABLE_3FB_HELPER_SERVICE__ /* ensure the new content has been displayed*/ if (pFrameBuffer != s_pLastFB) { sdl_refr_cpl = true; @@ -251,6 +242,14 @@ void VT_sdl_refresh_task(void) #else sdl_refr_cpl = true; #endif + + + SDL_UpdateTexture(texture, NULL, tft_fb, VT_WIDTH * sizeof(uint32_t)); + SDL_RenderClear(renderer); + + /*Update the renderer with the texture containing the rendered image*/ + SDL_RenderCopy(renderer, texture, NULL, NULL); + SDL_RenderPresent(renderer); } SDL_Event event;