game/sdlpp/sdlpp_texture.hpp
2021-03-07 13:18:58 +01:00

34 lines
1.0 KiB
C++

#ifndef SDLPP_HPP_TEXTURE
#define SDLPP_HPP_TEXTURE
#include <memory>
#include "sdlpp_common.hpp"
#include "sdlpp_font.hpp"
#include "sdlpp_renderer.hpp"
namespace SDLPP {
class SDLPPSCOPE Texture {
public:
Texture() = delete;
Texture( std::shared_ptr< Renderer > &renderer,
const std::string &img_path )
: Texture( renderer, img_path, "" ) {}
Texture( std::shared_ptr< Renderer > &renderer, const std::string &img_path,
const std::string &color_key );
Texture( std::shared_ptr< Renderer > &renderer, Font &font,
const std::string &text, const std::string &color = "FFFFFF",
const std::string &outline_color = "000000",
const int outline_size = -1 );
virtual ~Texture();
SDL_Texture *getTexturePtr();
void setAlpha( uint8_t alpha );
private:
void setTextureFromSurface( std::shared_ptr< Renderer > &renderer,
SDL_Surface *surface );
SDL_Texture *texture = NULL;
};
} // end of namespace SDLPP
#endif