Click or drag to resize

TextureSubCopy Method

Copies pixels from a part of the current framebuffer into the texture.

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public void SubCopy(
	int xOffset,
	int yOffset,
	int left,
	int bottom,
	int width,
	int height,
	int level = 0,
	int cubeTarget = 0
)

Parameters

xOffset
Type: SystemInt32
texel offset in the X direction within the texture array.
yOffset
Type: SystemInt32
texel offset in the Y direction within the texture array.
left
Type: SystemInt32
window coordinate of the left corner of the rectangular region of pixels to be copied.
bottom
Type: SystemInt32
window coordinate of the bottom corner of the rectangular region of pixels to be copied.
width
Type: SystemInt32
the width of the texture subimage.
height
Type: SystemInt32
the height of the texture subimage.
level (Optional)
Type: SystemInt32
(optional) level-of-detail number if updating separate mipmap levels. Level 0 (default) is the base image level. Level N is the Nth mipmap reduction image.
cubeTarget (Optional)
Type: SystemInt32
(optional) if this texture is a cube texture, then this parameter specifies which of the 6 cube faces to update. This parameter is ignored for 2D textures.
Exceptions
ExceptionCondition
GLExceptionInvalidValue if level is less than 0 or greater than the maximum level.
GLExceptionInvalidValue if xOffset < 0 or xOffset + width is greater than the width of this texture.
GLExceptionInvalidValue if yOffset < 0 or yOffset + height is greater than the height of this texture.
GLExceptionInvalidValue if width or height is less than 0.
GLExceptionInvalidOperation if the currently bound framebuffer's format does not contain a superset of the components required by the base format.
GLExceptionInvalidFramebufferOperation if the currently bound framebuffer is not framebuffer complete.
Remarks
This method replaces a rectangular portion of a two-dimensional texture image or cube-map texture image with pixels from the current framebuffer (rather than from client memory, as is the case for SubUploadT(glPixelFormat, Int32, Int32, Int32, Int32, T, Int32, glPixelDataType, Int32)).

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

See Also

Reference