Image settings now survive setMode, fixes bug #10

This commit is contained in:
Bart van Strien
2010-08-04 13:38:22 +02:00
parent 5235ceac53
commit 29c68d06f1
3 changed files with 52 additions and 40 deletions
+6 -1
View File
@@ -272,7 +272,7 @@ namespace opengl
void Image::unload() void Image::unload()
{ {
unloadVolatile(); return unloadVolatile();
} }
bool Image::loadVolatile() bool Image::loadVolatile()
@@ -295,11 +295,16 @@ namespace opengl
GL_UNSIGNED_BYTE, GL_UNSIGNED_BYTE,
data->getData()); data->getData());
setFilter(settings.filter);
setWrap(settings.wrap);
return true; return true;
} }
void Image::unloadVolatile() void Image::unloadVolatile()
{ {
settings.filter = getFilter();
settings.wrap = getWrap();
// Delete the hardware texture. // Delete the hardware texture.
if(texture != 0) if(texture != 0)
{ {
+7
View File
@@ -62,6 +62,13 @@ namespace opengl
// The source vertices of the image. // The source vertices of the image.
vertex vertices[4]; vertex vertices[4];
// The settings we need to save when reloading.
struct
{
Image::Filter filter;
Image::Wrap wrap;
} settings;
public: public:
/** /**