Workaround for broken VSync in Simulate on macOS.
OpenGL VSync became broken again in macOS 13 (https://github.com/glfw/glfw/issues/2249). This workaround is similar to https://github.com/glfw/glfw/pull/2277 but is implemented entirely outside of GLFW. PiperOrigin-RevId: 516320722 Change-Id: Ib8a651a942f592c74e00ad3c7b22f2dfd156be5f
This commit is contained in:
committed by
Copybara-Service
parent
3abf2ae2cd
commit
2f0fb1e4ef
@@ -17,6 +17,11 @@
|
||||
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#define GLFW_EXPOSE_NATIVE_NSGL
|
||||
#include <GLFW/glfw3native.h>
|
||||
#endif
|
||||
|
||||
namespace mujoco {
|
||||
// Dynamic dispatch table for GLFW functions required by Simulate.
|
||||
// This allows us to use GLFW without introducing a link-time dependency on the
|
||||
@@ -58,6 +63,11 @@ struct Glfw {
|
||||
mjGLFW_DECLARE_SYMBOL(glfwWindowHint);
|
||||
mjGLFW_DECLARE_SYMBOL(glfwWindowShouldClose);
|
||||
// go/keep-sorted end
|
||||
|
||||
#ifdef __APPLE__
|
||||
mjGLFW_DECLARE_SYMBOL(glfwGetNSGLContext);
|
||||
#endif
|
||||
|
||||
#undef mjGLFW_DECLARE_SYMBOL
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user