From 7de83dca3bb13d9c2809225f9669651baf121d36 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Mon, 14 Oct 2019 00:27:31 -0400 Subject: [PATCH] Use GLFW's glfwGetOpenedFilename() --- dep/glfw | 2 +- include/window.hpp | 8 ++++++++ src/main.cpp | 8 ++++---- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/dep/glfw b/dep/glfw index d9ab59ef..0fb001cf 160000 --- a/dep/glfw +++ b/dep/glfw @@ -1 +1 @@ -Subproject commit d9ab59efc781c392128a449361a381fcc93cf6f3 +Subproject commit 0fb001cf43da351bf6f7eea1cf8db5ae86cefc78 diff --git a/include/window.hpp b/include/window.hpp index acb5b1ea..bdd7eb0f 100644 --- a/include/window.hpp +++ b/include/window.hpp @@ -8,6 +8,14 @@ #define GLEW_NO_GLU #include #include +#if defined ARCH_WIN + #define GLFW_EXPOSE_NATIVE_WIN32 +#elif defined ARCH_MAC + #define GLFW_EXPOSE_NATIVE_COCOA +#elif defined ARCH_LIN + #define GLFW_EXPOSE_NATIVE_X11 +#endif +#include #include #define NANOVG_GL2 #include diff --git a/src/main.cpp b/src/main.cpp index 9ba8d019..f08ac23f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -163,11 +163,11 @@ int main(int argc, char* argv[]) { // On Mac, use a hacked-in GLFW addition to get the launched path. #if defined ARCH_MAC - // For some reason, launching from the command line sets glfwGetOpenedFilename(), so make sure we're running the app bundle. + // For some reason, launching from the command line sets glfwGetOpenedFilenames(), so make sure we're running the app bundle. if (asset::bundlePath != "") { - const char* openedFilename = glfwGetOpenedFilename(); - if (openedFilename) { - patchPath = openedFilename; + const char* const* openedFilenames = glfwGetOpenedFilenames(); + if (openedFilenames && openedFilenames[0]) { + patchPath = openedFilenames[0]; } } #endif