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:
committed by
Copybara-Service
parent
8b7eb097db
commit
01b0ea5b7d
@@ -57,7 +57,9 @@ namespace mujoco::studio {
|
|||||||
// - async physics
|
// - async physics
|
||||||
|
|
||||||
static constexpr toolbox::Window::Config kWindowConfig = {
|
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,
|
.render_config = toolbox::Window::RenderConfig::kFilamentVulkan,
|
||||||
#elif defined(USE_FILAMENT_OPENGL)
|
#elif defined(USE_FILAMENT_OPENGL)
|
||||||
.render_config = toolbox::Window::RenderConfig::kFilamentOpenGL,
|
.render_config = toolbox::Window::RenderConfig::kFilamentOpenGL,
|
||||||
@@ -163,10 +165,11 @@ void App::OnModelLoaded(std::string_view model_file) {
|
|||||||
tmp_ = UiTempState();
|
tmp_ = UiTempState();
|
||||||
mjv_defaultOption(&vis_options_);
|
mjv_defaultOption(&vis_options_);
|
||||||
ClearProfilerData();
|
ClearProfilerData();
|
||||||
if (model_file.empty()) {
|
if (!model_file.empty() &&
|
||||||
window_->SetTitle("MuJoCo Studio");
|
(model_file.ends_with(".xml") || model_file.ends_with(".mjb"))) {
|
||||||
} else {
|
|
||||||
window_->SetTitle("MuJoCo Studio : " + std::string(model_file));
|
window_->SetTitle("MuJoCo Studio : " + std::string(model_file));
|
||||||
|
} else {
|
||||||
|
window_->SetTitle("MuJoCo Studio");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user