mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-04-11 02:11:44 +08:00
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).
This commit is contained in:
parent
f2de2c88ff
commit
13039e8db5
@ -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;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user