![]() | TextureCopy Method |
Namespace: Ooogles
public void Copy( glPixelFormat format, int left, int bottom, int width, int height, int level = 0, int cubeTarget = 0 )
Exception | Condition |
---|---|
GLException | InvalidValue if this is a cube map texture and the width and height parameters are not equal. |
GLException | InvalidValue if level is less than 0 or greater than the maximum level. |
GLException | InvalidValue if width or height is less than 0 or greater than then maximum texture size. |
GLException | InvalidOperation if the currently bound framebuffer's format does not contain a superset of the components required by the base format of format. |
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