VEGO-Engine  0.1
Loading...
Searching...
No Matches
TextureManager.h
1#pragma once
2
3#include <SDL_render.h>
4#include <map>
5#include <memory>
6#include <string>
7#include <vector>
8
10{
11 public:
14 for (auto& it : this->texture_cache) {
15 SDL_DestroyTexture(it.second);
16 }
17 }
18
19 std::map<std::string, SDL_Texture*> texture_cache;
20
21 SDL_Texture* loadTexture(const char* fileName);
22 static std::vector<SDL_Rect> splitSpriteSheet(SDL_Texture* spriteSheet, int width, int height, int spritesOnSheet);
23 static void draw(SDL_Texture* texture, SDL_Rect src, SDL_Rect dest, bool flipped = false);
24};
Definition TextureManager.h:10