From d658d7a300f925941feccfe1ecc0c07d6f37ad62 Mon Sep 17 00:00:00 2001 From: Dane Johnson Date: Mon, 26 Apr 2021 21:10:07 -0500 Subject: [PATCH] Change working directory to first argument if present for Windows Drag and Drop compatibility --- core/couch.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/couch.cpp b/core/couch.cpp index 639aa3c..e01f81d 100644 --- a/core/couch.cpp +++ b/core/couch.cpp @@ -1,3 +1,6 @@ +// C includes +#include + // C++ includes #include @@ -54,7 +57,12 @@ void render(Node *curr, Shader *shader, Matrix model) { } } -int main() { +int main(int argc, char *argv[]) { + + if (argc == 2) { + chdir(argv[1]); + } + Window window; window.Init();