Add the logo in the about page

This commit is contained in:
Guillaume Meunier
2024-02-18 09:03:46 +01:00
parent 7ab68210f6
commit 9fc95dbd17
7 changed files with 111 additions and 9 deletions
+11 -1
View File
@@ -631,7 +631,16 @@ void scenes::lobby::on_focused()
};
swapchain_imgui = xr::swapchain(session, device, swapchain_format, 1500, 1000);
imgui_ctx.emplace(device, queue_family_index, queue, world_space, imgui_inputs, swapchain_imgui, glm::vec2{1.0, 0.6666});
imgui_ctx.emplace(physical_device, device, queue_family_index, queue, world_space, imgui_inputs, swapchain_imgui, glm::vec2{1.0, 0.6666});
try
{
about_picture = imgui_ctx->load_texture("wivrn.ktx2");
}
catch(...)
{
about_picture = imgui_ctx->load_texture("wivrn.png");
}
}
void scenes::lobby::on_unfocused()
@@ -640,6 +649,7 @@ void scenes::lobby::on_unfocused()
renderer->wait_idle(); // Must be before the scene data because the renderer uses its descriptor sets
about_picture = nullptr;
imgui_ctx.reset();
lobby_scene.reset(); // Must be reset before the renderer so that the descriptor sets are freed before their pools
controllers_scene.reset();
+1
View File
@@ -108,6 +108,7 @@ class lobby : public scene_impl<lobby>
tab current_tab = tab::server_list;
tab last_current_tab = tab::server_list;
ImTextureID about_picture;
void gui_connecting();
void gui_server_list();
+9 -2
View File
@@ -241,7 +241,7 @@ void scenes::lobby::gui_server_list()
// ImGui::SetTooltip("Tooltip");
// }
ImVec2 button_position(ImGui::GetWindowContentRegionMax().x + style.FramePadding.x, pos.y + (list_item_height - button_size.y) / 2);
ImVec2 button_position(ImGui::GetWindowContentRegionMax().x - style.WindowPadding.x - 20, pos.y + (list_item_height - button_size.y) / 2);
button_position.x -= button_size.x + style.WindowPadding.x;
ImGui::SetCursorPos(button_position);
@@ -320,8 +320,15 @@ void scenes::lobby::gui_server_list()
void scenes::lobby::gui_about()
{
ImGui::PushFont(imgui_ctx->large_font);
ImGui::TextWrapped("WiVRn %s", xrt::drivers::wivrn::git_version);
CenterTextH(std::string("WiVRn ") + xrt::drivers::wivrn::git_version);
ImGui::PopFont();
ImGui::Dummy(ImVec2(0, 60));
float win_width = ImGui::GetWindowSize().x;
ImGui::SetCursorPosX(win_width / 4);
ImGui::Image(about_picture, {win_width / 2, win_width / 2});
}
static bool RadioButtonWithoutCheckBox(const char * label, bool active, ImVec2 size_arg)