From 13039e8db5decf8b73982821fc0344578ff8510f Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Wed, 25 Feb 2026 23:20:55 +0100 Subject: [PATCH] Draw a dark square when no texture is rendered Draw a dark 10x10 square in the top-right corner to distinguish a black frame from the absence of a frame (useful for debugging). --- app/src/screen.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/src/screen.c b/app/src/screen.c index 9b88b2f4..d50b670f 100644 --- a/app/src/screen.c +++ b/app/src/screen.c @@ -205,11 +205,23 @@ sc_screen_render(struct sc_screen *screen, bool update_content_rect) { } SDL_Renderer *renderer = screen->renderer; + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0); sc_sdl_render_clear(renderer); bool ok = false; SDL_Texture *texture = screen->tex.texture; if (!texture) { + // Draw a dark 10x10 square in the top-right corner to distinguish a + // black frame from the absence of a frame + struct sc_size render_size = sc_sdl_get_render_output_size(renderer); + SDL_SetRenderDrawColor(renderer, 0, 0, 0x33, 0xff); + SDL_FRect rect = { + .x = render_size.width - 20, + .y = 10, + .w = 10, + .h = 10, + }; + SDL_RenderFillRect(renderer, &rect); goto end; }