mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-20 21:35:12 +00:00
sources and include in the same folder
This commit is contained in:
46
lib/Ray/sources/Drawables/Image.cpp
Normal file
46
lib/Ray/sources/Drawables/Image.cpp
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
** EPITECH PROJECT, 2021
|
||||
** Bomberman
|
||||
** File description:
|
||||
** Image
|
||||
*/
|
||||
|
||||
#include "Drawables/Image.hpp"
|
||||
|
||||
RAY::Image::Image(const std::string &filename):
|
||||
_image(LoadImage(filename.c_str()))
|
||||
{
|
||||
}
|
||||
|
||||
RAY::Image::Image()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
RAY::Image::~Image()
|
||||
{
|
||||
UnloadImage(_image);
|
||||
}
|
||||
|
||||
bool RAY::Image::load(const std::string &filename)
|
||||
{
|
||||
this->_image = LoadImage(filename.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RAY::Image::exportTo(const std::string &outputPath)
|
||||
{
|
||||
ExportImage(_image, outputPath.c_str());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool RAY::Image::unload()
|
||||
{
|
||||
UnloadImage(_image);
|
||||
return true;
|
||||
}
|
||||
|
||||
::Image &RAY::Image::getImage(void)
|
||||
{
|
||||
return _image;
|
||||
}
|
||||
Reference in New Issue
Block a user