mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 05:15:10 +00:00
51 lines
770 B
C++
51 lines
770 B
C++
/*
|
|
** EPITECH PROJECT, 2021
|
|
** Bomberman
|
|
** File description:
|
|
** Texture
|
|
*/
|
|
|
|
#include "Drawables/Texture.hpp"
|
|
|
|
RAY::Texture::Texture(const std::string &filename):
|
|
_texture(LoadTexture(filename.c_str()))
|
|
{
|
|
}
|
|
|
|
RAY::Texture::Texture(const Image &image):
|
|
_texture(LoadTextureFromImage(image))
|
|
{
|
|
|
|
}
|
|
|
|
RAY::Texture::Texture()
|
|
{
|
|
|
|
}
|
|
|
|
RAY::Texture::~Texture()
|
|
{
|
|
UnloadTexture(this->_texture);
|
|
}
|
|
|
|
bool RAY::Texture::load(const std::string &filename)
|
|
{
|
|
this->_texture = LoadTexture(filename.c_str());
|
|
return true;
|
|
}
|
|
|
|
Image RAY::Texture::toImage(void) const
|
|
{
|
|
return GetTextureData(_texture);
|
|
}
|
|
|
|
const ::Texture &RAY::Texture::getTexture(void) const
|
|
{
|
|
return this->_texture;
|
|
}
|
|
|
|
bool RAY::Texture::unload()
|
|
{
|
|
UnloadTexture(this->_texture);
|
|
return true;
|
|
} |