mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 05:15:10 +00:00
31 lines
552 B
C++
31 lines
552 B
C++
/*
|
|
** EPITECH PROJECT, 2021
|
|
** Bomberman
|
|
** File description:
|
|
** Texture
|
|
*/
|
|
|
|
#include "Drawables/Texture.hpp"
|
|
|
|
namespace RAY {
|
|
|
|
Cache<::Texture> Texture::_texturesCache(LoadTexture, UnloadTexture);
|
|
|
|
Texture::Texture(const std::string &filename, bool lonely):
|
|
_texture(_texturesCache.fetch(filename, lonely)),
|
|
_resourcePath(filename)
|
|
{
|
|
}
|
|
|
|
Texture::Texture(const Image &image):
|
|
_texture(std::make_shared<::Texture>(LoadTextureFromImage(image))),
|
|
_resourcePath()
|
|
{
|
|
}
|
|
|
|
Texture::operator ::Texture() const
|
|
{
|
|
return *this->_texture;
|
|
}
|
|
}
|