Group screen parameters into a struct

The function screen_init_rendering had too many parameters.
This commit is contained in:
Romain Vimont
2021-02-25 22:00:34 +01:00
parent 955da3b578
commit 597c54f049
3 changed files with 54 additions and 35 deletions

View File

@@ -384,12 +384,20 @@ scrcpy(const struct scrcpy_options *options) {
screen_init(&screen, &video_buffer, &fps_counter);
if (!screen_init_rendering(&screen, window_title, frame_size,
options->always_on_top, options->window_x,
options->window_y, options->window_width,
options->window_height,
options->window_borderless,
options->rotation, options->mipmaps)) {
struct screen_params screen_params = {
.window_title = window_title,
.frame_size = frame_size,
.always_on_top = options->always_on_top,
.window_x = options->window_x,
.window_y = options->window_y,
.window_width = options->window_width,
.window_height = options->window_height,
.window_borderless = options->window_borderless,
.rotation = options->rotation,
.mipmaps = options->mipmaps,
};
if (!screen_init_rendering(&screen, &screen_params)) {
goto end;
}