possible crash fixes

This commit is contained in:
LightCat 2018-09-17 19:12:32 +02:00
parent d99d5fcb7f
commit 7ccff46237

View File

@ -48,6 +48,8 @@ void texture::bind()
void texture::load(const std::string &path)
{
try
{
png::image<png::rgba_pixel> image(path);
width = image.get_width();
height = image.get_height();
@ -62,6 +64,11 @@ void texture::load(const std::string &path)
memcpy(data + image.get_width() * 4 * i,
image.get_pixbuf().get_row(i).data(), image.get_width() * 4);
}
}
catch (...)
{
}
}
void texture::unload()