UpdateTexture2D Data Member Function

Updates a 2D texture that is currently resident on the GPU. You must use this if you wish to update 2D textures, 1D array textures, and cubemaps.

Prototype

int32 UpdateTexture2D( Texture p_oTexture, Image p_oImage, int32 p_nLevel, Int32Vector poSrcPos, Int32Vector p_oOffsets, Int32Vector p_poDims )

Parameters

Parameter Type Parameter Name Documentation
<Texture>p_oTextureA pointer to the <Texture> object you wish to update. This texture must be resident on the GPU.
<Image>p_oImageA pointer to the <Image> containing the new data you wish to use to update the <Texture>.
int32p_nLevelThe MIP-map level you wish to update. Must be 0 to (MIP map count - 1).
<Int32Vector>poSrcPosA pointer to the <Int32Vector> that contains the source positions. Component[0] = source position X, which determines the x pixel coordinate of the location that will be read from in the source <Image>. Component[1] = source position Y, which determines the y pixel coordinate of the location that will be read from in the source <Image>. The source position X value must be from 0 to (image width - 1), and the source position Y value must be from 0 to (image height - 1 ).
<Int32Vector>p_oOffsetsA pointer to the <Int32Vector> that contains the destination positions. Component[0] = destination position X, which determines the x pixel coordinate of the location that will be written to in the destination <Texture>. Component[1] = destination position Y, which determines the y pixel coordinate of the location that will be written to in the destination <Texture>. The destination position X value must be from 0 to (image width - 1), and the destination position Y value must be from 0 to (image height - 1 ).
<Int32Vector>p_poDimsA pointer to the <Int32Vector> that contains the write dimensions. Component[0] = width X, which determines the x pixel width of the source <Image> that will be written to the destination <Texture>. Component[1] = height Y, which determines the y pixel height of the source <Image> that will be written to the destination <Texture>. The width and height values must respect the source <Image> dimensions and the render dimensions of the destination <Texture> being updated.

Examples

Copy Text To Clipboard

None published. Please look for an example in the Scenome Scripting Language code base.