Click or drag to resize

TextureReserve Method

Reserve memory for a texture of given dimensions.

Namespace:  Ooogles
Assembly:  Ooogles (in Ooogles.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public void Reserve(
	glPixelFormat format,
	int width,
	int height,
	int level = 0,
	glPixelDataType type = glPixelDataType.UnsignedByte,
	int cubeTarget = 0
)

Parameters

format
Type: OooglesglPixelFormat
the format of the texel data.
width
Type: SystemInt32
the width of the texture image. All implementations support 2D texture images that are at least 64 texels wide and cube-mapped texture images that are at least 16 texels wide.
height
Type: SystemInt32
the height of the texture image. All implementations support 2D texture images that are at least 64 texels high and cube-mapped texture images that are at least 16 texels high.
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.
Exceptions
ExceptionCondition
GLExceptionInvalidValue if this is a cube map texture and the width and height parameters are not equal.
GLExceptionInvalidValue if level is less than 0 or greater than the maximum level.
GLExceptionInvalidValue if width or height is less than 0 or greater than the maximum texture size.
GLExceptionInvalidOperation if type is UnsignedShort565 and format is not Rgb.
GLExceptionInvalidOperation if type is UnsignedShort4444 or UnsignedShort5551 and format is not Rgba.
Remarks
This creates the texture in memory, but does not set the image data yet.

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.

To reserve memory for texture images, call Reserve. The arguments describe the parameters of the texture image, such as height, width, level-of-detail number (see MinificationFilter), and format. The other arguments describe how the image is represented in memory.

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.

OpenGL API: glTexImage2D

See Also

Reference