]> git.localhorst.tv Git - orbi.git/blobdiff - src/app/SDL.h
resolve data path relative to executable
[orbi.git] / src / app / SDL.h
index ce116d5d576bad0339627aa7754cc17d3021546b..c18f7c2fad3f7ae0db0f38343f6da3cb3a23ff15 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef ORBI_SDL_H_
 #define ORBI_SDL_H_
 
+#include <memory>
+#include <string>
 #include <SDL.h>
 
 
@@ -15,6 +17,11 @@ public:
        SDL(const SDL &) = delete;
        SDL &operator =(const SDL &) = delete;
 
+       std::string GetBasePath() const {
+               std::unique_ptr<char, decltype(&SDL_free)> base{SDL_GetBasePath(), &SDL_free};
+               return std::string(base.get());
+       }
+
 };
 
 }