invert rgbaPixels, fixes #5013

This commit is contained in:
codeanticode
2017-04-23 16:33:58 -04:00
parent 6b0ae7c15b
commit d2b35401b6
2 changed files with 3 additions and 1 deletions
@@ -5479,7 +5479,7 @@ public class PGraphicsOpenGL extends PGraphics {
endPixelsOp();
} else {
// We only need to copy the pixels to the back texture where we are
// currently drawing to. Because the texture is invertex along Y, we
// currently drawing to. Because the texture is inverted along Y, we
// need to reflect that in the vertical arguments.
pgl.copyToTexture(texture.glTarget, texture.glFormat, texture.glName,
x, pixelHeight - (y + h), w, h, nativePixelBuffer);
+2
View File
@@ -340,6 +340,8 @@ public class Texture implements PConstants {
loadPixels(w * h);
convertToRGBA(pixels, format, w, h);
if (invertedX) flipArrayOnX(rgbaPixels, 1);
if (invertedY) flipArrayOnY(rgbaPixels, 1);
updatePixelBuffer(rgbaPixels);
pgl.texSubImage2D(glTarget, 0, x, y, w, h, PGL.RGBA, PGL.UNSIGNED_BYTE,
pixelBuffer);