#ifndef ORBI_SDL_H_
#define ORBI_SDL_H_
+#include <memory>
+#include <string>
#include <SDL.h>
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());
+ }
+
};
}
#include "Texture.h"
#include "Vector.h"
+#include <string>
#include <SDL.h>
Texture CreateStaticTexture(Vector<int> size);
Texture LoadTexture(const char *file);
+ Texture LoadTexture(const std::string &file) {
+ return LoadTexture(file.c_str());
+ }
void Copy(Texture &, Vector<int> to);
void Copy(Texture &, Rect<int> clip, Vector<int> to);
));
Tileset tiles(
- canv.LoadTexture("/home/holy/projects/orbi/data/test-tile.png"),
+ canv.LoadTexture(sdl.GetBasePath() + "../../data/test-tile.png"),
Vector<int>(32, 32)
);