Gl.TexSubImage1D (gb.opengl)
Static Sub TexSubImage1D ( Image As Image, XOffset As Integer, Width As Integer [ , Level As Integer ] )
自从 3.6
Specify a one-dimensional texture subimage.
Parameters
- target
-
Specifies the target texture.
Must be Gl.TEXTURE_1D.
- level
-
Specifies the level-of-detail number.
Level 0 is the base image level.
Level n is the nth mipmap reduction image.
- xoffset
-
Specifies a texel offset in the x direction within the texture array.
- width
-
Specifies the width of the texture subimage.
- format
-
Specifies the format of the pixel data.
The following symbolic values are accepted:
Gl.RED,
Gl.RG,
Gl.RGB,
Gl.BGR,
Gl.RGBA, and
Gl.BGRA.
- type
-
Specifies the data type of the pixel data.
The following symbolic values are accepted:
Gl.UNSIGNED_BYTE,
Gl.BYTE,
Gl.UNSIGNED_SHORT,
Gl.SHORT,
Gl.UNSIGNED_INT,
Gl.INT,
Gl.FLOAT,
Gl.UNSIGNED_BYTE_3_3_2,
Gl.UNSIGNED_BYTE_2_3_3_REV,
Gl.UNSIGNED_SHORT_5_6_5,
Gl.UNSIGNED_SHORT_5_6_5_REV,
Gl.UNSIGNED_SHORT_4_4_4_4,
Gl.UNSIGNED_SHORT_4_4_4_4_REV,
Gl.UNSIGNED_SHORT_5_5_5_1,
Gl.UNSIGNED_SHORT_1_5_5_5_REV,
Gl.UNSIGNED_INT_8_8_8_8,
Gl.UNSIGNED_INT_8_8_8_8_REV,
Gl.UNSIGNED_INT_10_10_10_2, and
Gl.UNSIGNED_INT_2_10_10_10_REV.
- data
-
Specifies a pointer to the image data in memory.
Description
Texturing maps a portion of a specified texture image
onto each graphical primitive for which texturing is enabled.
To enable or disable one-dimensional texturing, call Gl.Enable
and Gl.Disable with argument
Gl.TEXTURE_1D.
Gl.TexSubImage1D redefines a contiguous subregion of an existing one-dimensional
texture image.
The texels referenced by
data replace the portion of the
existing texture array with x indices
xoffset and
,
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.
If a non-zero named buffer object is bound to the Gl.PIXEL_UNPACK_BUFFER target
(see Gl.BindBuffer) while a texture image is
specified,
data is treated as a byte offset into the buffer object's data store.
Notes
Gl.PixelStore modes affect texture images.
Gl.TexSubImage1D specifies a one-dimensional subtexture for the current texture unit,
specified with
Gl.ActiveTexture.
Errors
Gl.INVALID_ENUM is generated if
target is not one of the
allowable values.
Gl.INVALID_ENUM is generated if
format is not an accepted
format constant.
Gl.INVALID_ENUM is generated if
type is not a type constant.
Gl.INVALID_VALUE is generated if
level is less than 0.
Gl.INVALID_VALUE may be generated if
level is greater
than
max,
where
max is the returned value of
Gl.MAX_TEXTURE_SIZE.
Gl.INVALID_VALUE is generated if
,
or if
,
where
is the
Gl.TEXTURE_WIDTH, and
is
the width of the
Gl.TEXTURE_BORDER
of the texture image being modified.
Note that
includes twice the border width.
Gl.INVALID_VALUE is generated if
width is less than 0.
Gl.INVALID_OPERATION is generated if the texture array has not
been defined by a previous
Gl.TexImage1D operation.
Gl.INVALID_OPERATION is generated if
type is one of
Gl.UNSIGNED_BYTE_3_3_2,
Gl.UNSIGNED_BYTE_2_3_3_REV,
Gl.UNSIGNED_SHORT_5_6_5, or
Gl.UNSIGNED_SHORT_5_6_5_REV
and
format is not
Gl.RGB.
Gl.INVALID_OPERATION is generated if
type is one of
Gl.UNSIGNED_SHORT_4_4_4_4,
Gl.UNSIGNED_SHORT_4_4_4_4_REV,
Gl.UNSIGNED_SHORT_5_5_5_1,
Gl.UNSIGNED_SHORT_1_5_5_5_REV,
Gl.UNSIGNED_INT_8_8_8_8,
Gl.UNSIGNED_INT_8_8_8_8_REV,
Gl.UNSIGNED_INT_10_10_10_2, or
Gl.UNSIGNED_INT_2_10_10_10_REV
and
format is neither
Gl.RGBA nor
Gl.BGRA.
Gl.INVALID_OPERATION is generated if a non-zero buffer object name is bound to the
Gl.PIXEL_UNPACK_BUFFER target and the buffer object's data store is currently mapped.
Gl.INVALID_OPERATION is generated if a non-zero buffer object name is bound to the
Gl.PIXEL_UNPACK_BUFFER target and the data would be unpacked from the buffer
object such that the memory reads required would exceed the data store size.
Gl.INVALID_OPERATION is generated if a non-zero buffer object name is bound to the
Gl.PIXEL_UNPACK_BUFFER target and
data is not evenly divisible
into the number of bytes needed to store in memory a datum indicated by
type.
Associated Gets
Gl.GetTexImage
Gl.Get with argument Gl.PIXEL_UNPACK_BUFFER_BINDING
See also
Gl.CopyTexSubImage1D
Gl.CopyTexSubImage2D
Gl.CopyTexSubImage3D
Gl.PixelStore
Gl.TexImage3D
Gl.TexParameter
Gl.TexSubImage2D
Gl.TexSubImage3D
See original documentation on OpenGL website