From 46f9577dc12c8d1b87fdabe6e45521782a84a8df Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 29 Apr 2019 15:42:13 -0400 Subject: [PATCH] Disable system::setThreadRealTime on Mac. Fix GLFW init hints on Mac. --- src/system.cpp | 5 +++-- src/window.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/system.cpp b/src/system.cpp index ce81c4ee..3c7d8cbf 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -106,7 +106,7 @@ void setThreadName(const std::string &name) { } void setThreadRealTime(bool realTime) { -#if defined ARCH_LIN || defined ARCH_MAC +#if defined ARCH_LIN int err; int policy; struct sched_param param; @@ -125,7 +125,8 @@ void setThreadRealTime(bool realTime) { // pthread_getschedparam(pthread_self(), &policy, ¶m); // DEBUG("policy %d priority %d", policy, param.sched_priority); - +#elif defined ARCH_MAC + // Not yet implemented #elif defined ARCH_WIN // Set process class first if (realTime) { diff --git a/src/window.cpp b/src/window.cpp index d5bc0846..a7bf44de 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -201,8 +201,6 @@ Window::Window() { #if defined ARCH_MAC glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_TRUE); - glfwWindowHint(GLFW_COCOA_CHDIR_RESOURCES, GLFW_TRUE); - glfwWindowHint(GLFW_COCOA_MENUBAR, GLFW_TRUE); #endif // Create window @@ -491,6 +489,11 @@ void windowInit() { int err; // Set up GLFW +#if defined ARCH_MAC + glfwInitHint(GLFW_COCOA_CHDIR_RESOURCES, GLFW_TRUE); + glfwInitHint(GLFW_COCOA_MENUBAR, GLFW_TRUE); +#endif + glfwSetErrorCallback(errorCallback); err = glfwInit(); if (err != GLFW_TRUE) {