Browse Source

Use GLFW's glfwGetOpenedFilename()

tags/v1.1.6
Andrew Belt 2 years ago
parent
commit
7de83dca3b
3 changed files with 13 additions and 5 deletions
  1. +1
    -1
      dep/glfw
  2. +8
    -0
      include/window.hpp
  3. +4
    -4
      src/main.cpp

+ 1
- 1
dep/glfw

@@ -1 +1 @@
Subproject commit d9ab59efc781c392128a449361a381fcc93cf6f3
Subproject commit 0fb001cf43da351bf6f7eea1cf8db5ae86cefc78

+ 8
- 0
include/window.hpp View File

@@ -8,6 +8,14 @@
#define GLEW_NO_GLU
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#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 <GLFW/glfw3native.h>
#include <nanovg.h>
#define NANOVG_GL2
#include <nanovg_gl.h>


+ 4
- 4
src/main.cpp View File

@@ -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


Loading…
Cancel
Save