Allow custom memory management in IImage

This commit is contained in:
Benau 2017-03-12 09:09:40 +08:00
parent a274f217ed
commit 27fcc4e266
3 changed files with 8 additions and 0 deletions

View File

@ -98,6 +98,8 @@ public:
//! fills the surface with given color
virtual void fill(const SColor &color) =0;
virtual void setDeleteMemory(bool val) = 0;
//! get the amount of Bits per Pixel of the given color format
static u32 getBitsPerPixelFromFormat(const ECOLOR_FORMAT format)
{

View File

@ -457,6 +457,10 @@ inline SColor CImage::getPixelBox( s32 x, s32 y, s32 fx, s32 fy, s32 bias ) cons
return c;
}
void CImage::setDeleteMemory(bool val)
{
DeleteMemory = val;
}
} // end namespace video
} // end namespace irr

View File

@ -103,6 +103,8 @@ public:
//! fills the surface with given color
virtual void fill(const SColor &color);
virtual void setDeleteMemory(bool val);
private:
//! assumes format and size has been set and creates the rest