diff options
author | dec05eba <dec05eba@protonmail.com> | 2019-08-06 17:07:10 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2019-08-06 17:07:13 +0200 |
commit | 31ac4c0061f0c34b99ddf2643e912efa5549d0bd (patch) | |
tree | ac9e9f80d830edf0e00eefdf430da5da78a5d1f3 /src | |
parent | d3f830aa5d35804e7c206b973a8734058cb08fbe (diff) |
Change directory to main dir, to make resources load
Diffstat (limited to 'src')
-rw-r--r-- | src/QuickMedia.cpp | 2 | ||||
-rw-r--r-- | src/main.cpp | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp index a9087b1..5de8a0f 100644 --- a/src/QuickMedia.cpp +++ b/src/QuickMedia.cpp @@ -27,7 +27,7 @@ namespace QuickMedia { image_index(0) { window.setVerticalSyncEnabled(true); - if(!font.loadFromFile("fonts/Lato-Regular.ttf")) { + if(!font.loadFromFile("../../../fonts/Lato-Regular.ttf")) { fprintf(stderr, "Failed to load font!\n"); abort(); } diff --git a/src/main.cpp b/src/main.cpp index 1b85cbf..2899565 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,10 @@ #include "../include/QuickMedia.hpp" #include <X11/Xlib.h> +#include <libgen.h> +#include <unistd.h> int main(int argc, char **argv) { + chdir(dirname(argv[0])); XInitThreads(); QuickMedia::Program program; return program.run(argc, argv); |