Skip to content
Snippets Groups Projects
sdl_resources.h 773 B
Newer Older
#ifndef SDL_RESOURCES_H
#define SDL_RESOURCES_H

#include <SDL2/SDL.h>

#include <string>

/// Resource class that load all the resources for game rendering.
class sdl_resources {
public:
    /// Loads resources
    explicit sdl_resources(SDL_Renderer* renderer);
    /// Unloads resources
    ~sdl_resources();

    /// Shooter texture
    const SDL_Texture* shooter;
    /// Projectile texture
    const SDL_Texture* projectile;
Tomas Vybiral's avatar
Tomas Vybiral committed
    /// Enemy 1 texture
    const SDL_Texture* enemy1;
    /// Enemy 2 texture
    const SDL_Texture* enemy2;
    /// Enemy 3 texture
    const SDL_Texture* enemy3;
protected:
    SDL_Renderer* renderer;
    /// Loads texture by path defined by path
    SDL_Texture* load_texture(const std::string& path_to_image);
};

#endif//SDL_RESOURCES_H