Move function that parses the graphics mode from a string into graphics_mode.cc.

PiperOrigin-RevId: 878482669
Change-Id: I8b713bc740c5711b9c7cc9ea63c21bad42cd2943
This commit is contained in:
Haroon Qureshi
2026-03-04 07:29:59 -08:00
committed by Copybara-Service
parent c70b05e037
commit 64597f45d3
3 changed files with 32 additions and 14 deletions
+2 -14
View File
@@ -105,20 +105,8 @@ int main(int argc, char** argv, char** envp) {
std::string gfx = absl::GetFlag(FLAGS_gfx);
mujoco::platform::GraphicsMode gfx_mode =
mujoco::platform::GraphicsMode::FilamentVulkan;
if (gfx == "classic") {
gfx_mode = mujoco::platform::GraphicsMode::ClassicOpenGl;
} else if (gfx == "classic_headless") {
gfx_mode = mujoco::platform::GraphicsMode::ClassicOpenGlHeadless;
} else if (gfx == "opengl") {
gfx_mode = mujoco::platform::GraphicsMode::FilamentOpenGl;
} else if (gfx == "opengl_headless") {
gfx_mode = mujoco::platform::GraphicsMode::FilamentOpenGlHeadless;
} else if (gfx == "vulkan" || gfx.empty()) {
gfx_mode = mujoco::platform::GraphicsMode::FilamentVulkan;
} else {
mju_error("Unsupported graphics API: %s", gfx.c_str());
}
mujoco::platform::GraphicsModeFromString(
gfx, mujoco::platform::GraphicsMode::FilamentVulkan);
const int width = absl::GetFlag(FLAGS_window_width);
const int height = absl::GetFlag(FLAGS_window_height);