Use webgl backend in emscripten builds.

(Also only display the model name if its a file.)

PiperOrigin-RevId: 828498906
Change-Id: I7def85992f413b321c115ea63db2af057f5fd372
This commit is contained in:
Haroon Qureshi
2025-11-05 09:16:44 -08:00
committed by Copybara-Service
parent 8b7eb097db
commit 01b0ea5b7d
+7 -4
View File
@@ -57,7 +57,9 @@ namespace mujoco::studio {
// - async physics
static constexpr toolbox::Window::Config kWindowConfig = {
#if defined(USE_FILAMENT_VULKAN)
#ifdef EMSCRIPTEN
.render_config = toolbox::Window::RenderConfig::kFilamentWebGL,
#elif defined(USE_FILAMENT_VULKAN)
.render_config = toolbox::Window::RenderConfig::kFilamentVulkan,
#elif defined(USE_FILAMENT_OPENGL)
.render_config = toolbox::Window::RenderConfig::kFilamentOpenGL,
@@ -163,10 +165,11 @@ void App::OnModelLoaded(std::string_view model_file) {
tmp_ = UiTempState();
mjv_defaultOption(&vis_options_);
ClearProfilerData();
if (model_file.empty()) {
window_->SetTitle("MuJoCo Studio");
} else {
if (!model_file.empty() &&
(model_file.ends_with(".xml") || model_file.ends_with(".mjb"))) {
window_->SetTitle("MuJoCo Studio : " + std::string(model_file));
} else {
window_->SetTitle("MuJoCo Studio");
}
}