![]() | TextureSubCopy Method |
Namespace: Ooogles
public void SubCopy( int xOffset, int yOffset, int left, int bottom, int width, int height, int level = 0, int cubeTarget = 0 )
Exception | Condition |
---|---|
GLException | InvalidValue if level is less than 0 or greater than the maximum level. |
GLException | InvalidValue if xOffset < 0 or xOffset + width is greater than the width of this texture. |
GLException | InvalidValue if yOffset < 0 or yOffset + height is greater than the height of this texture. |
GLException | InvalidValue if width or height is less than 0. |
GLException | InvalidOperation if the currently bound framebuffer's format does not contain a superset of the components required by the base format. |
GLException | InvalidFramebufferOperation if the currently bound framebuffer is not framebuffer complete. |
The screen-aligned pixel rectangle with lower left corner at left, bottom and with width width and height height replaces the portion of the texture array with X indices xOffset through xOffset + width - 1, inclusive, and Y indices yOffset through yOffset + height - 1, inclusive, at the mipmap level specified by level.
The pixels in the rectangle are processed exactly as if ReadPixelsT(Int32, Int32, Int32, Int32, T, glPixelFormat, glPixelDataType) had been called with format set to Rgba, but the process stops just after conversion of Rgba values. Subsequent processing is identical to that described for SubUploadT(glPixelFormat, Int32, Int32, Int32, Int32, T, Int32, glPixelDataType, Int32), beginning with the clamping of the R, G, B, and A values to the range 0-1 and then conversion to the texture's internal format for storage in the texel array.
The destination rectangle in the texture array may not include any texels outside the texture array as it was originally specified. It is not an error to specify a subtexture with zero width or height, but such a specification has no effect.
If any of the pixels within the specified rectangle are outside the framebuffer associated with the current rendering context, then the values obtained for those pixels are undefined.
No change is made to the internal format, width, or height parameters of the texture array or to texel values outside the specified subregion.
Note: in DEBUG mode with assertions enabled, an error will be logged to the debug console if this texture is not bound.
OpenGL API: glCopyTexSubImage2D