summaryrefslogtreecommitdiff
path: root/src/texture.h
blob: 00779ff724abaad0a7ed0eb3e0e09013c782299c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef TEXTURE_H
#define TEXTURE_H
#include <SDL2/SDL.h>
#include <string>

class Texture{
    public:
        Texture(SDL_Renderer* renderer);
        ~Texture();
        int loadFromFile(std::string path);
        void render(int x, int y, SDL_Rect* clip = nullptr);
    private:
        SDL_Texture* texture_;
        int w_;
        int h_;
        SDL_Renderer* renderer_;
};
#endif