try to change to working directory on startup so assets can be found

This commit is contained in:
Sven Balzer
2025-09-29 06:24:58 +02:00
parent c3c0f8adf7
commit 5a77a4aacb
4 changed files with 48 additions and 1 deletions
+16
View File
@@ -0,0 +1,16 @@
#include "change_directory.h"
#include <SDL3/SDL_platform.h>
#if SDL_PLATFORM_LINUX
#include <unistd.h>
#elif SDL_PLATFORM_WINDOWS
#include <direct.h>
#endif
void change_directory(const char *path) {
#if SDL_PLATFORM_LINUX
chdir(path);
#elif SDL_PLATFORM_WINDOWS
_chdir(path);
#endif
}