 | TextureSubUploadT Method (glPixelFormat, Int32, Int32, Int32, Int32, T, Int32, glPixelDataType, Int32) |
Uploads a part of an image to the texture.
Namespace:
Ooogles
Assembly:
Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntaxpublic void SubUpload<T>(
glPixelFormat format,
int xOffset,
int yOffset,
int width,
int height,
T[,] data,
int level = 0,
glPixelDataType type = glPixelDataType.UnsignedByte,
int cubeTarget = 0
)
where T : struct, new()
Public Sub SubUpload(Of T As {Structure, New}) (
format As glPixelFormat,
xOffset As Integer,
yOffset As Integer,
width As Integer,
height As Integer,
data As T(,),
Optional level As Integer = 0,
Optional type As glPixelDataType = glPixelDataType.UnsignedByte,
Optional cubeTarget As Integer = 0
)
public:
generic<typename T>
where T : value class, gcnew()
void SubUpload(
glPixelFormat format,
int xOffset,
int yOffset,
int width,
int height,
array<T,2>^ data,
int level = 0,
glPixelDataType type = glPixelDataType::UnsignedByte,
int cubeTarget = 0
)
member SubUpload :
format : glPixelFormat *
xOffset : int *
yOffset : int *
width : int *
height : int *
data : 'T[,] *
?level : int *
?type : glPixelDataType *
?cubeTarget : int
(* Defaults:
let _level = defaultArg level 0
let _type = defaultArg type glPixelDataType.UnsignedByte
let _cubeTarget = defaultArg cubeTarget 0
*)
-> unit when 'T : struct, new()
Parameters
- format
- Type: OooglesglPixelFormat
the 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
two-dimensional array with the 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. - type (Optional)
- Type: OooglesglPixelDataType
(optional) data type the texel data. Defaults to UnsignedByte. - 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
ExceptionsException | Condition |
---|
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 | InvalidOperation if the texture array has not been defined by a previous UploadT(glPixelFormat, Int32, Int32, T, Int32, glPixelDataType, Int32),
Reserve(glPixelFormat, Int32, Int32, Int32, glPixelDataType, Int32) or Copy(glPixelFormat, Int32, Int32, Int32, Int32, Int32, Int32) operation
whose format matches the format parameter of this method. |
GLException | InvalidOperation if type is UnsignedShort565 and format is not Rgb. |
GLException | InvalidOperation if type is UnsignedShort4444 or UnsignedShort5551 and format is not Rgba. |
Remarks
This updates the texture in memory.
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,
inclusive, and 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 zero width or height, but such a specification has no effect.
Note: in DEBUG mode with assertions enabled, an error will be logged to the debug console if this texture is not bound.
OpenGL API: glTexSubImage2D
See Also