static struct swapchain_data *new_swapchain_data(VkSwapchainKHR swapchain,
struct device_data *device_data)
{
+ struct instance_data *instance_data = device_data->instance;
struct swapchain_data *data = rzalloc(NULL, struct swapchain_data);
data->device = device_data;
data->swapchain = swapchain;
- data->window_size = ImVec2(300, 300);
+ data->window_size = ImVec2(instance_data->params.width, instance_data->params.height);
map_object((void *) data->swapchain, data);
return data;
}
return strtol(str, NULL, 0) != 0;
}
+static unsigned
+parse_unsigned(const char *str)
+{
+ return strtol(str, NULL, 0);
+}
+
+#define parse_width(s) parse_unsigned(s)
+#define parse_height(s) parse_unsigned(s)
+
static bool
parse_help(const char *str)
{
fprintf(stderr, "\tfps_sampling_period=number-of-milliseconds\n");
fprintf(stderr, "\tno_display=0|1\n");
fprintf(stderr, "\toutput_file=/path/to/output.txt\n");
+ fprintf(stderr, "\twidth=width-in-pixels\n");
+ fprintf(stderr, "\theight=height-in-pixels\n");
return true;
}
params->enabled[OVERLAY_PARAM_ENABLED_fps] = true;
params->enabled[OVERLAY_PARAM_ENABLED_frame_timing] = true;
params->fps_sampling_period = 500000; /* 500ms */
+ params->width = params->height = 300;
if (!env)
return;
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_file) \
OVERLAY_PARAM_CUSTOM(position) \
+ OVERLAY_PARAM_CUSTOM(width) \
+ OVERLAY_PARAM_CUSTOM(height) \
OVERLAY_PARAM_CUSTOM(no_display) \
OVERLAY_PARAM_CUSTOM(help)
uint32_t fps_sampling_period; /* us */
bool help;
bool no_display;
+ unsigned width;
+ unsigned height;
};
const extern char *overlay_param_names[];