aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-06 17:07:10 +0200
committerdec05eba <dec05eba@protonmail.com>2019-08-06 17:07:13 +0200
commit31ac4c0061f0c34b99ddf2643e912efa5549d0bd (patch)
treeac9e9f80d830edf0e00eefdf430da5da78a5d1f3 /src
parentd3f830aa5d35804e7c206b973a8734058cb08fbe (diff)
Change directory to main dir, to make resources load
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp2
-rw-r--r--src/main.cpp3
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);