Added histogram param

pull/197/head
FlightlessMango 4 years ago
parent 15ed8df404
commit ac926bbfd5

@ -1472,10 +1472,17 @@ void render_imgui(swapchain_stats& data, struct overlay_params& params, ImVec2&
ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
double min_time = 0.0f;
double max_time = 50.0f;
ImGui::PlotLines(hash, get_time_stat, &data,
ARRAY_SIZE(data.frames_stats), 0,
NULL, min_time, max_time,
ImVec2(ImGui::GetContentRegionAvailWidth() - params.font_size * 2.2, 50));
if (params.enabled[OVERLAY_PARAM_ENABLED_histogram]){
ImGui::PlotHistogram(hash, get_time_stat, &data,
ARRAY_SIZE(data.frames_stats), 0,
NULL, min_time, max_time,
ImVec2(ImGui::GetContentRegionAvailWidth() - params.font_size * 2.2, 50));
} else {
ImGui::PlotLines(hash, get_time_stat, &data,
ARRAY_SIZE(data.frames_stats), 0,
NULL, min_time, max_time,
ImVec2(ImGui::GetContentRegionAvailWidth() - params.font_size * 2.2, 50));
}
ImGui::PopStyleColor();
}
if (params.enabled[OVERLAY_PARAM_ENABLED_frame_timing]){
@ -2208,6 +2215,7 @@ static void setup_swapchain_data_pipeline(struct swapchain_data *data)
void imgui_custom_style(struct overlay_params& params){
ImGuiStyle& style = ImGui::GetStyle();
style.Colors[ImGuiCol_PlotLines] = ImGui::ColorConvertU32ToFloat4(params.frametime_color);
style.Colors[ImGuiCol_PlotHistogram] = ImGui::ColorConvertU32ToFloat4(params.frametime_color);
style.Colors[ImGuiCol_WindowBg] = ImGui::ColorConvertU32ToFloat4(params.background_color);
style.Colors[ImGuiCol_Text] = ImGui::ColorConvertU32ToFloat4(params.text_color);
style.CellPadding.y = -2;

@ -47,6 +47,7 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_BOOL(vulkan_driver) \
OVERLAY_PARAM_BOOL(gpu_name) \
OVERLAY_PARAM_BOOL(engine_version) \
OVERLAY_PARAM_BOOL(histogram) \
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_file) \
OVERLAY_PARAM_CUSTOM(font_file) \

Loading…
Cancel
Save