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.BindTexture (gb.opengl)

Static Sub BindTexture ( Target As Integer, Texture As Integer )

Bind a named texture to a texturing target.

Parameters

target

Specifies the target to which the texture is bound. Must be either Gl.TEXTURE_1D, Gl.TEXTURE_2D, Gl.TEXTURE_3D, or Gl.TEXTURE_1D_ARRAY, Gl.TEXTURE_2D_ARRAY, Gl.TEXTURE_RECTANGLE, Gl.TEXTURE_CUBE_MAP, Gl.TEXTURE_2D_MULTISAMPLE or Gl.TEXTURE_2D_MULTISAMPLE_ARRAY.
texture

Specifies the name of a texture.

Description

Gl.BindTexture lets you create or use a named texture. Calling Gl.BindTexture with target set to Gl.TEXTURE_1D, Gl.TEXTURE_2D, Gl.TEXTURE_3D, or Gl.TEXTURE_1D_ARRAY, Gl.TEXTURE_2D_ARRAY, Gl.TEXTURE_RECTANGLE, Gl.TEXTURE_CUBE_MAP, Gl.TEXTURE_2D_MULTISAMPLE or Gl.TEXTURE_2D_MULTISAMPLE_ARRAY and texture set to the name of the new texture binds the texture name to the target. When a texture is bound to a target, the previous binding for that target is automatically broken.

Texture names are unsigned integers. The value zero is reserved to represent the default texture for each texture target. Texture names and the corresponding texture contents are local to the shared object space of the current GL rendering context; two rendering contexts share texture names only if they explicitly enable sharing between contexts through the appropriate GL windows interfaces functions.

You must use Gl.GenTextures to generate a set of new texture names.

When a texture is first bound, it assumes the specified target: A texture first bound to Gl.TEXTURE_1D becomes one-dimensional texture, a texture first bound to Gl.TEXTURE_2D becomes two-dimensional texture, a texture first bound to Gl.TEXTURE_3D becomes three-dimensional texture, a texture first bound to Gl.TEXTURE_1D_ARRAY becomes one-dimensional array texture, a texture first bound to Gl.TEXTURE_2D_ARRAY becomes two-dimensional arary texture, a texture first bound to Gl.TEXTURE_RECTANGLE becomes rectangle texture, a, texture first bound to Gl.TEXTURE_CUBE_MAP becomes a cube-mapped texture, a texture first bound to Gl.TEXTURE_2D_MULTISAMPLE becomes a two-dimensional multisampled texture, and a texture first bound to Gl.TEXTURE_2D_MULTISAMPLE_ARRAY becomes a two-dimensional multisampled array texture. The state of a one-dimensional texture immediately after it is first bound is equivalent to the state of the default Gl.TEXTURE_1D at GL initialization, and similarly for the other texture types.

While a texture is bound, GL operations on the target to which it is bound affect the bound texture, and queries of the target to which it is bound return state from the bound texture. In effect, the texture targets become aliases for the textures currently bound to them, and the texture name zero refers to the default textures that were bound to them at initialization.

A texture binding created with Gl.BindTexture remains active until a different texture is bound to the same target, or until the bound texture is deleted with Gl.DeleteTextures.

Once created, a named texture may be re-bound to its same original target as often as needed. It is usually much faster to use Gl.BindTexture to bind an existing named texture to one of the texture targets than it is to reload the texture image using Gl.TexImage1D, Gl.TexImage2D, Gl.TexImage3D or another similar function.

Notes

The Gl.TEXTURE_2D_MULTISAMPLE and Gl.TEXTURE_2D_MULTISAMPLE_ARRAY targets are available only if the GL version is 3.2 or higher.

Errors

Gl.INVALID_ENUM is generated if target is not one of the allowable values.

Gl.INVALID_VALUE is generated if target is not a name returned from a previous call to Gl.GenTextures.

Gl.INVALID_OPERATION is generated if texture was previously created with a target that doesn't match that of target.

Associated Gets

Gl.Get with argument Gl.TEXTURE_BINDING_1D, Gl.TEXTURE_BINDING_2D, Gl.TEXTURE_BINDING_3D, Gl.TEXTURE_BINDING_1D_ARRAY, Gl.TEXTURE_BINDING_2D_ARRAY, Gl.TEXTURE_BINDING_RECTANGLE, Gl.TEXTURE_BINDING_2D_MULTISAMPLE, or Gl.TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY.

See Also

Gl.DeleteTextures, Gl.GenTextures, Gl.Get, Gl.GetTexParameter, Gl.IsTexture, Gl.TexImage1D, Gl.TexImage2D, Gl.TexImage2DMultisample, Gl.TexImage3D, Gl.TexImage3DMultisample, Gl.TexParameter


Copyright © 1991-2006 Silicon Graphics, Inc. This document is licensed under the SGI Free Software B License. For details, see http://oss.sgi.com/projects/FreeB.

➡ See original documentation