Use runtime enum for the renderer backend instead of preprocessor macros.
TESTED: studio:vulkan studio:vulkan --offscreen_mode=true studio:opengl studio:opengl_egl studio:classic studio:classic --offscreen_mode=true studio:server robot_sim/frontend:debug_server pyviewer:example pyviewer:example --define=mujoco_gl=vulkan PiperOrigin-RevId: 864768322 Change-Id: I4478e0115b3807060d60d98b4ddfd63da9389aac
This commit is contained in:
committed by
Copybara-Service
parent
24e5b966c3
commit
1a2bca4986
@@ -46,17 +46,6 @@
|
||||
|
||||
namespace mujoco::studio {
|
||||
|
||||
static constexpr platform::Window::RenderConfig kRenderConfig =
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
platform::Window::RenderConfig::kFilamentWebGL;
|
||||
#elif defined(USE_FILAMENT_VULKAN)
|
||||
platform::Window::RenderConfig::kFilamentVulkan;
|
||||
#elif defined(USE_FILAMENT_OPENGL)
|
||||
platform::Window::RenderConfig::kFilamentOpenGL;
|
||||
#elif defined(USE_CLASSIC_OPENGL)
|
||||
platform::Window::RenderConfig::kClassicOpenGL;
|
||||
#endif
|
||||
|
||||
static void ToggleFlag(mjtByte& flag) { flag = flag ? 0 : 1; }
|
||||
|
||||
static void ToggleWindow(bool& window) {
|
||||
@@ -115,7 +104,7 @@ static constexpr std::array<const char*, 31> kPercentRealTime = {
|
||||
App::App(Config config)
|
||||
: ini_path_(std::move(config.ini_path)) {
|
||||
platform::Window::Config window_config;
|
||||
window_config.render_config = kRenderConfig;
|
||||
window_config.renderer_backend = platform::Renderer::GetBackend();
|
||||
window_config.offscreen_mode = config.offscreen_mode;
|
||||
window_ = std::make_unique<platform::Window>("MuJoCo Studio", config.width,
|
||||
config.height, window_config);
|
||||
|
||||
Reference in New Issue
Block a user