Save now creates opaque images from primary surface

Fixes #3031
This commit is contained in:
Jakub Valtar
2015-01-28 17:14:13 +01:00
parent 7dbb5e605e
commit 5999bfc14c
@@ -5629,6 +5629,29 @@ public class PGraphicsOpenGL extends PGraphics {
}
//////////////////////////////////////////////////////////////
// SAVE
@Override
public boolean save(String filename) {
// Act as opaque surface for the purposes of saving.
// This is a hack, primary surface is supposed to be
// opaque by default.
if (primarySurface) {
int prevFormat = format;
format = RGB;
boolean result = super.save(filename);
format = prevFormat;
return result;
}
return super.save(filename);
}
//////////////////////////////////////////////////////////////
// LOAD/UPDATE TEXTURE