Files
WiVRn/client/scenes/gui_common.h
T
2026-07-26 17:24:36 +02:00

74 lines
1.9 KiB
C++

/*
* WiVRn VR streaming
* Copyright (C) 2022-2026 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2022-2026 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "render/ui_widgets.h"
#include <optional>
#include <string>
#include <openxr/openxr.h>
class configuration;
class imgui_context;
namespace xr
{
class instance;
class session;
class system;
} // namespace xr
namespace wivrn
{
namespace gui
{
bool refresh_rate(
xr::instance & instance,
xr::session & session,
imgui_context & imgui_ctx,
configuration & config);
bool body_tracking_parts(
xr::system & system,
imgui_context & imgui_ctx,
configuration & config,
bool in_game);
bool post_processing(
imgui_context & imgui_ctx,
configuration & config);
float toggle_width();
// Battery pill shown in the top bar: the icon+percent label and the threshold colour.
struct battery_indicator
{
std::string label;
wivrn::ui::chip_style style;
};
// Current headset battery as a top-bar pill, or nullopt when unavailable (always nullopt
// off Android). now drives the charging animation. Shared by the lobby and in-stream GUI.
std::optional<battery_indicator> battery_status_indicator(XrTime now);
} // namespace gui
} // namespace wivrn