Click or drag to resize

TextureCopy Method

Copies pixels from 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 Copy(
	glPixelFormat format,
	int left,
	int bottom,
	int width,
	int height,
	int level = 0,
	int cubeTarget = 0
)

Parameters

format
Type: OooglesglPixelFormat
the format of the texel data.
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 image. All implementations support 2D texture images that are at least 64 texels wide and cube-mapped texture images that are at least 16 texels wide.
height
Type: SystemInt32
the height of the texture image. All implementations support 2D texture images that are at least 64 texels high and cube-mapped texture images that are at least 16 texels high.
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 this is a cube map texture and the width and height parameters are not equal.
GLExceptionInvalidValue if level is less than 0 or greater than the maximum level.
GLExceptionInvalidValue if width or height is less than 0 or greater than then maximum texture size.
GLExceptionInvalidOperation if the currently bound framebuffer's format does not contain a superset of the components required by the base format of format.
Remarks
This method defines 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 UploadT(glPixelFormat, Int32, Int32, T, Int32, glPixelDataType, Int32)).

The screen-aligned pixel rectangle with lower left corner at (left, bottom) and with a width of width and a height of height defines the texture array at the mipmap level specified by level. format specifies the internal format of the texture array.

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 UploadT(glPixelFormat, 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 components required for format must be a subset of those present in the framebuffer's format. For example, a Rgba framebuffer can be used to supply components for any format. However, a Rgb framebuffer can only be used to supply components for Rgb or Luminance base internal format textures, not Alpha, LuminanceAlpha or Rgba textures.

Pixel ordering is such that lower left and bottom screen coordinates correspond to lower S and T texture coordinates.

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.

Note: a GL implementation may choose to store the texture array at any internal resolution it chooses.

Note: an image with height or width of 0 indicates a NULL texture.

Note: This method specifies a two-dimensional or cube-map texture for the current texture unit, specified with BindToTextureUnit(Int32).

Note: in DEBUG mode with assertions enabled, an error will be logged to the debug console if this texture is not bound.

OpenGL API: glCopyTexImage2D

See Also

Reference