try to change to working directory on startup so assets can be found
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user