Click or drag to resize

TextureSubUploadCompressedT Method

Uploads a part of a compressed image to the texture.

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
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()

Parameters

format
Type: SystemInt32
the compressed format of the texel data.
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.
width
Type: SystemInt32
the width of the texture subimage.
height
Type: SystemInt32
the height of the texture subimage.
data
Type: T
array containing the compressed image data in memory.
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.

Type Parameters

T
The type of data in the data array.
Exceptions
ExceptionCondition
GLExceptionInvalidEnum if format is not a supported format returned in CompressedTextureFormats.
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.
GLExceptionInvalidValue if the length of data is not consistent with the format, dimensions, and contents of the specified compressed image data.
GLExceptionInvalidOperation 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.
GLExceptionInvalidOperation if parameter combinations are not supported by the specific compressed internal format as specified in the specific texture compression extension.
Remarks
This updates the texture in memory.

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

See Also

Reference