Gambas文档
编译和安装
错误消息
代码片段
待办事项
废弃的组件
教程
开发环境文档
开发者文档
名词解释
如何操作
说明
维基手册
维基搜索
维基许可协议
文档
应用程序仓库
语言概览
语言索引
主题
组件
gb
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.qt
gb.gui.qt.ext
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.highlight
gb.image
gb.image.effect
gb.image.io
gb.inotify
gb.logging
gb.map
gb.media
gb.media.form
gb.mime
gb.mongodb
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.opengl
Gl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webview
gb.qt6
gb.qt6.ext
gb.qt6.opengl
gb.qt6.webview
gb.report
gb.report2
gb.sdl
gb.sdl2
gb.sdl2.audio
gb.settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
最近的修改

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 xoffset + width - 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 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 log 2 max, where max is the returned value of Gl.MAX_TEXTURE_SIZE.

Gl.INVALID_VALUE is generated if xoffset < - b , or if xoffset + width > w - b , where w is the Gl.TEXTURE_WIDTH, and b is the width of the Gl.TEXTURE_BORDER of the texture image being modified. Note that w 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