![]() | TextureSubUploadCompressedT Method |
Namespace: Ooogles
public void SubUploadCompressed<T>( int format, int xOffset, int yOffset, int width, int height, T[] data, int level = 0, int cubeTarget = 0 ) where T : struct, new()
Exception | Condition |
---|---|
GLException | InvalidEnum if format is not a supported format returned in CompressedTextureFormats. |
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 | InvalidValue if the length of data is not consistent with the format, dimensions, and contents of the specified compressed image data. |
GLException | InvalidOperation if the texture array has not been defined by a previous UploadCompressedT(Int32, Int32, Int32, T, Int32, Int32) operation whose format matches the format of this method. |
GLException | InvalidOperation if parameter combinations are not supported by the specific compressed internal format as specified in the specific texture compression extension. |
Texturing maps a portion of a specified texture image onto each graphical primitive for which texturing is active. Texturing is active when the current fragment shader or vertex shader makes use of built-in texture lookup functions.
This method redefines a contiguous subregion of an existing two-dimensional texture image. The texels referenced by data replace the portion of the existing texture array with X indices xOffset and xOffset + width - 1, and the Y indices yOffset and yOffset + height - 1, inclusive. This region may not include any texels outside the range of the texture array as it was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect.
format must be the same extension-specified compressed-texture format previously specified by UploadCompressedT(Int32, Int32, Int32, T, Int32, Int32).
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.
Note: Undefined results, including abnormal program termination, are generated if data is not encoded in a manner consistent with the extension specification defining the internal compression format.
OpenGL API: glCompressedTexSubImage2D