Hello !
This is quite a specific question, I know, but using the glCopyPixels or equivent (glReadPixel and glDrawPixels), I was able with glPixelZoom to update the section of a FrameBuffer with pixels, while allowing for interpolation and resizing.
For the same program, I need a specific function that copies the pixels of part of an image (stored as an OpenGL Texture)
glGetTexImage(GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_BYTE, *pixelRaster);
And I then want to update part of another texture with this pixel array, but allowing for zooming and repositionning.
I’ve already come across the glTexSubImage2D Function, but as far as I tested it only copies the pixels 1-to-1 and doesn’t allow for resizing.
Is there a way to do this ? Note that I am using JOGL, a Java implementation of OpenGL.
To be more specific (perhaps it could help) I want to create a function copy :
copy(int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh);
that takes the section defined by (sx, sy, sw, sh) of a texture and updating another (or the same) texture with these pixels on the region (dx, dy, dw, dh)