From 31ac4c0061f0c34b99ddf2643e912efa5549d0bd Mon Sep 17 00:00:00 2001 From: dec05eba Date: Tue, 6 Aug 2019 17:07:10 +0200 Subject: Change directory to main dir, to make resources load --- src/QuickMedia.cpp | 2 +- src/main.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') 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 +#include +#include int main(int argc, char **argv) { + chdir(dirname(argv[0])); XInitThreads(); QuickMedia::Program program; return program.run(argc, argv); -- cgit v1.2.3