Display Output resolution in preview window.

This commit is contained in:
brunoherbelin
2020-06-24 21:56:27 +02:00
parent 519b68d634
commit 804eba9ef3

View File

@@ -733,9 +733,17 @@ void UserInterface::RenderPreview()
if (ImGui::Selectable("##preview", false, ImGuiSelectableFlags_PressedOnClick, imagesize))
Rendering::manager().outputWindow().show();
ImGui::SetCursorScreenPos(draw_pos);
// preview image
ImGui::Image((void*)(intptr_t)output->texture(), imagesize);
// tooltip overlay
if (ImGui::IsItemHovered()) {
ImDrawList* draw_list = ImGui::GetWindowDrawList();
draw_list->AddRectFilled(draw_pos, ImVec2(draw_pos.x + width, draw_pos.y + ImGui::GetTextLineHeightWithSpacing()), IM_COL32(55, 55, 55, 200));
ImGui::SetCursorScreenPos(draw_pos);
ImGui::Text(" %d x %d px, %.1f fps", output->width(), output->height(), ImGui::GetIO().Framerate );
}
ImGui::End();
}