DemoGL::Reference::Functions::DEMOGL_TextureUpdateWithFBRegion

DEMOGL_TextureUpdateWithFBRegion

DEMOGL_TextureUpdateWithFBRegion updates an uploaded texture with with the color fragments from the backbuffer in the region specified. The region is (iX,iY) - ((iX + iWidth),(iY + iHeight)), and this region is placed in the texture on (iXDext, iYDest) as lower left corner.

int
DEMOGL_TextureUpdateWithFBRegion(
	const int iX,
	const int iY,
	const int iWidth,
	const int iHeight,
	const int iXDest,
	const int iYDest,
	const GLuint iTextureID,
	const int iDimensions
);
	
Parameters.
iX
Specifies the X-coordinate of the left lower corner of the region of the backbuffer which should be read for the texture data. This is a screencoordinate in pixels, starting from the left of the screen.
iY
Specifies the Y-coordinate of the left lower corner of the region of the backbuffer which should be read for the texture data. This is a screencoordinate in pixels, starting from the bottom of the screen.
iWidth
Specifies the width of the texture, which pixeldata is stored in the buffer pointed by pbyBuffer in pixels. Must be 2n for some integer n.
iHeight
Specifies the height of the texture, which pixeldata is stored in the buffer pointed by pbyBuffer in pixels. Must be 2n for some integer n.
iXDest
Specifies the X-coordinate of the left lower corner in the texture data where the region should be placed. This is in pixels.
iYDest
Specifies the Y-coordinate of the left lower corner in the texture data where the region should be placed. This is in pixels.
iTextureID
Specifies the TextureID of the texture which texturedata should be partial overwritten with the region from the framebuffer, as specified.
iDimensions
Specifies the amount of dimensions of the texture, needed for the upload process of the texture data to OpenGL. Can be one of the following values: DGL_TEXTUREDIMENSION_1D for 1D textures (only iWidth and iXDest is used), DGL_TEXTUREDIMENSION_2D for 2D textures (only iWidth, iHeight, iXDest and iYDest are used) or DGL_TEXTUREDIMENSION_3D for 3D textures, which are currently not implemented in full in DemoGL.

Return values.
If the function succeeds, it returns SYS_OK.
If the function fails, it returns SYS_NOK.

Remarks.
Support for 3D textures is not fully implemented in DemoGL due to the lack of OpenGL 1.2 support in the Windows OpenGL implementation. DEMOGL_TextureUpdateWithFBRegion will overwrite a part or completely the texturedata uploaded of the given texture. The texture data stored in the texture store inside DemoGL, if applicable, is left untouched. You can't update a texture's data if that particular texture is not uploaded, DemoGL will return SYS_NOK then.

Example.

Requirements.
DemoGL v1.3 (build 0112 or higher)

See also.
DEMOGL_TextureCreateFromBuffer, DEMOGL_TextureUpload

Last changed on 15-mar-2001

©1999-2001 Solutions Design