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
@@ -20,6 +20,8 @@
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
|
||||
#include "experimental/platform/renderer_backend.h"
|
||||
|
||||
#if __has_include("third_party/GL/gl/include/EGL/egl.h")
|
||||
#define MUJOCO_STUDIO_EGL_SUPPORTED 1
|
||||
#include "third_party/GL/gl/include/EGL/egl.h"
|
||||
@@ -35,16 +37,8 @@ namespace mujoco::platform {
|
||||
// handles events from the window.
|
||||
class Window {
|
||||
public:
|
||||
// Configures the window for the specified rendering backend.
|
||||
enum RenderConfig {
|
||||
kClassicOpenGL,
|
||||
kFilamentVulkan,
|
||||
kFilamentOpenGL,
|
||||
kFilamentWebGL,
|
||||
};
|
||||
|
||||
struct Config {
|
||||
RenderConfig render_config = kClassicOpenGL;
|
||||
RendererBackend renderer_backend = RendererBackend::ClassicOpenGl;
|
||||
bool enable_keyboard = true;
|
||||
bool load_fonts = true;
|
||||
bool offscreen_mode = false;
|
||||
|
||||
Reference in New Issue
Block a user