#ifndef DELTA_ASSETLOADER #define DELTA_ASSETLOADER #include #include #include #include #include #include "math.hpp" struct SDL_SurfaceDeleter { void operator()(SDL_Surface* surface) const { if (surface) { SDL_DestroySurface(surface); } } }; class DeltaAssetLoader { public: ~DeltaAssetLoader() { for (auto& [id, surface] : textures) { SDL_DestroySurface(surface); } } void loadTexture(std::string id, const char *path); void loadModel(std::string id, const char *path); SDL_Surface* getSurface(const std::string& id); void getModel(std::string id, const char *path); private: std::string base_path = "assets"; std::string img_path = "images"; std::string model_path = "models"; std::unordered_map textures; std::unordered_map models; }; #endif