mirror of
https://github.com/Kbz-8/42_vox.git
synced 2026-01-11 14:43:34 +00:00
working on chunk generation
This commit is contained in:
20
Application/Utils.h
git.filemode.normal_file
20
Application/Utils.h
git.filemode.normal_file
@@ -0,0 +1,20 @@
|
||||
#ifndef UTILS_H
|
||||
#define UTILS_H
|
||||
|
||||
#include <unistd.h>
|
||||
#include <climits>
|
||||
#include <filesystem>
|
||||
|
||||
inline std::filesystem::path GetExecutablePath()
|
||||
{
|
||||
char result[PATH_MAX];
|
||||
ssize_t count = readlink("/proc/self/exe", result, PATH_MAX);
|
||||
return std::string(result, (count > 0) ? count : 0);
|
||||
}
|
||||
|
||||
inline std::filesystem::path GetResourcesPath()
|
||||
{
|
||||
return GetExecutablePath().parent_path().parent_path() / "Resources";
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user