Put the tooltips in a different layer
This commit is contained in:
+11
-1
@@ -1245,7 +1245,17 @@ void scenes::lobby::on_focused()
|
||||
.vp_origin = {0, 1000},
|
||||
.vp_size = {1500, 300},
|
||||
.z_index = constants::lobby::zindex_recenter_tip,
|
||||
}};
|
||||
},
|
||||
{
|
||||
// Tooltip
|
||||
.space = xr::spaces::world,
|
||||
.size = {0.6, 0.08},
|
||||
.vp_origin = {0, 1300},
|
||||
.vp_size = {1500, 200},
|
||||
.tooltip_viewport = true,
|
||||
.z_index = constants::lobby::zindex_tooltip,
|
||||
},
|
||||
};
|
||||
|
||||
xr::swapchain swapchain_imgui(instance, session, device, swapchain_format, 3000, 1500);
|
||||
|
||||
|
||||
@@ -476,14 +476,23 @@ void scenes::stream::on_focused()
|
||||
device,
|
||||
swapchain_format,
|
||||
1800,
|
||||
1000);
|
||||
1200);
|
||||
|
||||
imgui_context::viewport vp{
|
||||
.space = xr::spaces::world,
|
||||
// Position and orientation are set at each frame
|
||||
.size = {1.2, 0.6666},
|
||||
.vp_origin = {0, 0},
|
||||
.vp_size = {1800, 1000},
|
||||
std::vector<imgui_context::viewport> vps{
|
||||
{
|
||||
.space = xr::spaces::world,
|
||||
// Position and orientation are set at each frame
|
||||
.size = {1.2, 0.6666},
|
||||
.vp_origin = {0, 0},
|
||||
.vp_size = {1800, 1000},
|
||||
},
|
||||
{
|
||||
.space = xr::spaces::world,
|
||||
.size = {1.2, 0.1333},
|
||||
.vp_origin = {0, 1000},
|
||||
.vp_size = {1800, 200},
|
||||
.tooltip_viewport = true,
|
||||
},
|
||||
};
|
||||
|
||||
imgui_ctx.emplace(physical_device,
|
||||
@@ -492,7 +501,7 @@ void scenes::stream::on_focused()
|
||||
queue,
|
||||
imgui_inputs,
|
||||
std::move(swapchain_imgui),
|
||||
std::vector{vp},
|
||||
std::move(vps),
|
||||
image_cache);
|
||||
|
||||
if (application::get_config().enable_stream_gui)
|
||||
|
||||
@@ -835,7 +835,8 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
|
||||
const ImGuiStyle & style = ImGui::GetStyle();
|
||||
imgui_ctx->new_frame(predicted_display_time);
|
||||
|
||||
ImVec2 content_size{ImGui::GetMainViewport()->Size - ImVec2{tab_width, 0} - margin_around_window * 2};
|
||||
ImVec2 viewport_size(imgui_ctx->layers()[0].vp_size.x, imgui_ctx->layers()[0].vp_size.y);
|
||||
ImVec2 content_size{viewport_size - ImVec2{tab_width, 0} - margin_around_window * 2};
|
||||
ImVec2 content_center = margin_around_window + content_size / 2 + ImVec2{tab_width, 0};
|
||||
|
||||
bool display_tabs, always_auto_resize;
|
||||
@@ -851,7 +852,7 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
|
||||
case gui_status::hidden:
|
||||
case gui_status::bitrate_settings:
|
||||
case gui_status::foveation_settings:
|
||||
ImGui::SetNextWindowPos(ImGui::GetMainViewport()->Size / 2, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||
ImGui::SetNextWindowPos(viewport_size / 2, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
|
||||
always_auto_resize = true;
|
||||
display_tabs = false;
|
||||
break;
|
||||
@@ -866,13 +867,13 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
|
||||
case gui_status::settings:
|
||||
case gui_status::applications:
|
||||
ImGui::SetNextWindowPos(margin_around_window);
|
||||
ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size - margin_around_window * 2);
|
||||
ImGui::SetNextWindowSize(viewport_size - margin_around_window * 2);
|
||||
always_auto_resize = false;
|
||||
display_tabs = true;
|
||||
break;
|
||||
case gui_status::application_launcher:
|
||||
ImGui::SetNextWindowPos(margin_around_window);
|
||||
ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size - margin_around_window * 2);
|
||||
ImGui::SetNextWindowSize(viewport_size - margin_around_window * 2);
|
||||
always_auto_resize = false;
|
||||
display_tabs = false;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user