We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bd37a1d commit 3c4ca57Copy full SHA for 3c4ca57
sdlpp.hpp
@@ -31,6 +31,7 @@ SOFTWARE.
31
#ifdef USE_SDLGFX
32
#include <SDL2_gfxPrimitives.h>
33
#endif
34
+#include <filesystem>
35
#include <functional>
36
#include <sstream>
37
@@ -577,4 +578,12 @@ namespace sdl
577
578
}
579
580
};
581
+
582
+ std::filesystem::path get_base_path()
583
+ {
584
+ using deleter = decltype([](void *ptr) { SDL_free(ptr); });
585
+ auto ptr = std::unique_ptr<char[], deleter>(SDL_GetBasePath());
586
+ return std::filesystem::path(reinterpret_cast<char8_t const *>(ptr.get()),
587
+ std::filesystem::path::native_format);
588
+ }
589
} // namespace sdl
0 commit comments