From 898518071abfbee697fabe18093ef514d5074283 Mon Sep 17 00:00:00 2001 From: fvanroie <15969459+fvanroie@users.noreply.github.com> Date: Sun, 21 Feb 2021 20:44:28 +0100 Subject: [PATCH] Test rotation and fullscreen --- lib/lv_drivers/display/monitor.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/lv_drivers/display/monitor.c b/lib/lv_drivers/display/monitor.c index 831ac7ff..fe0c0f27 100644 --- a/lib/lv_drivers/display/monitor.c +++ b/lib/lv_drivers/display/monitor.c @@ -62,6 +62,7 @@ typedef struct #else uint32_t tft_fb[LV_HOR_RES_MAX * LV_VER_RES_MAX]; #endif + double rotation; } monitor_t; /********************** @@ -293,6 +294,12 @@ void monitor_backlight(uint8_t level) window_update(&monitor); } +void monitor_title(const char* title) +{ + SDL_SetWindowTitle(monitor.window, title); + // SDL_SetWindowFullscreen(monitor.window, SDL_WINDOW_FULLSCREEN_DESKTOP); +} + static void monitor_sdl_init(void) { /*Initialize the SDL*/ @@ -408,7 +415,8 @@ static void window_update(monitor_t* m) // SDL_RenderDrawRect(renderer, &r); /*Update the renderer with the texture containing the rendered image*/ - SDL_RenderCopy(m->renderer, m->texture, NULL, NULL); + // SDL_RenderCopy(m->renderer, m->texture, NULL, NULL); + SDL_RenderCopyEx(m->renderer, m->texture, NULL, NULL, m->rotation, NULL, SDL_FLIP_NONE); SDL_RenderPresent(m->renderer); }