bindtexture.3gl 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. '\" e
  2. '\"! eqn | mmdoc
  3. '\"macro stdmacro
  4. .ds Vn Version 1.2
  5. .ds Dt 24 September 1999
  6. .ds Re Release 1.2.1
  7. .ds Dp Jan 14 18:30
  8. .ds Dm 01 bindtextu
  9. .ds Xs 62690 6 bindtexture.gl
  10. .TH GLBINDTEXTURE 3G
  11. .SH NAME
  12. .B "glBindTexture
  13. \- bind a named texture to a texturing target
  14. .SH C SPECIFICATION
  15. void \f3glBindTexture\fP(
  16. GLenum \fItarget\fP,
  17. .nf
  18. .ta \w'\f3void \fPglBindTexture( 'u
  19. GLuint \fItexture\fP )
  20. .fi
  21. .SH PARAMETERS
  22. .TP \w'\fItexture\fP\ \ 'u
  23. \f2target\fP
  24. Specifies the target to which the texture is bound.
  25. Must be either
  26. \%\f3GL_TEXTURE_1D\fP,
  27. \%\f3GL_TEXTURE_2D\fP, or
  28. \%\f3GL_TEXTURE_3D\fP.
  29. .TP
  30. \f2texture\fP
  31. Specifies the name of a texture.
  32. .SH DESCRIPTION
  33. \%\f3glBindTexture\fP lets you create or use a named texture. Calling \%\f3glBindTexture\fP with
  34. .br
  35. \f2target\fP set to
  36. \%\f3GL_TEXTURE_1D\fP, \%\f3GL_TEXTURE_2D\fP, \%\f3GL_TEXTURE_3D\fP and \f2texture\fP
  37. set to the name
  38. of the newtexture binds the texture name to the target.
  39. When a texture is bound to a target, the previous binding for that
  40. target is automatically broken.
  41. .P
  42. Texture names are unsigned integers. The value zero is reserved to
  43. represent the default texture for each texture target.
  44. Texture names and the corresponding texture contents are local to
  45. the shared display-list space (see \%\f3glXCreateContext\fP) of the current
  46. GL rendering context;
  47. two rendering contexts share texture names only if they
  48. also share display lists.
  49. .P
  50. You may use \%\f3glGenTextures\fP to generate a set of new texture names.
  51. .P
  52. When a texture is first bound, it assumes the dimensionality of its
  53. target: A texture first bound to \%\f3GL_TEXTURE_1D\fP becomes
  54. one-dimensional, and a texture first bound to \%\f3GL_TEXTURE_2D\fP becomes
  55. two-dimensional, and a texture first bound to \%\f3GL_TEXTURE_3D\fP becomes
  56. a three-dimensional texture. The state of a one-dimensional texture
  57. immediately after it is first bound is equivalent to the state of the
  58. default \%\f3GL_TEXTURE_1D\fP at GL initialization, and similarly for
  59. two-, and three-dimensional textures.
  60. .P
  61. While a texture is bound, GL operations on the target to which it is
  62. bound affect the bound texture, and queries of the target to which it
  63. is bound return state from the bound texture. If texture mapping of
  64. the dimensionality of the target to which a texture is bound is
  65. active, the bound texture is used.
  66. In effect, the texture targets become aliases for the textures currently
  67. bound to them, and the texture name zero refers to the default textures
  68. that were bound to them at initialization.
  69. .P
  70. A texture binding created with \%\f3glBindTexture\fP remains active until a different
  71. texture is bound to the same target, or until the bound texture is
  72. deleted with \%\f3glDeleteTextures\fP.
  73. .P
  74. Once created, a named texture may be re-bound to the target of the
  75. matching dimensionality as often as needed.
  76. It is usually much faster to use \%\f3glBindTexture\fP to bind an existing named
  77. texture to one of the texture targets than it is to reload the texture image
  78. using \%\f3glTexImage1D\fP, \%\f3glTexImage2D\fP, or \%\f3glTexImage3D\fP.
  79. For additional control over performance, use
  80. \%\f3glPrioritizeTextures\fP.
  81. .P
  82. \%\f3glBindTexture\fP is included in display lists.
  83. .SH NOTES
  84. \%\f3glBindTexture\fP is available only if the GL version is 1.1 or greater.
  85. .SH ERRORS
  86. \%\f3GL_INVALID_ENUM\fP is generated if \f2target\fP is not one of the allowable
  87. values.
  88. .P
  89. \%\f3GL_INVALID_OPERATION\fP is generated if \f2texture\fP has a dimensionality
  90. that doesn't match that of \f2target\fP.
  91. .P
  92. \%\f3GL_INVALID_OPERATION\fP is generated if \%\f3glBindTexture\fP is executed
  93. between the execution of \%\f3glBegin\fP and the corresponding
  94. execution of \%\f3glEnd\fP.
  95. .SH ASSOCIATED GETS
  96. \%\f3glGet\fP with argument \%\f3GL_TEXTURE_BINDING_1D\fP
  97. .br
  98. \%\f3glGet\fP with argument \%\f3GL_TEXTURE_BINDING_2D\fP
  99. .br
  100. \%\f3glGet\fP with argument \%\f3GL_TEXTURE_BINDING_3D\fP
  101. .SH SEE ALSO
  102. \%\f3glAreTexturesResident(3G)\fP,
  103. \%\f3glDeleteTextures(3G)\fP,
  104. \%\f3glGenTextures(3G)\fP,
  105. \%\f3glGet(3G)\fP,
  106. .br
  107. \%\f3glGetTexParameter(3G)\fP,
  108. \%\f3glIsTexture(3G)\fP,
  109. \%\f3glPrioritizeTextures(3G)\fP,
  110. \%\f3glTexImage1D(3G)\fP,
  111. \%\f3glTexImage2D(3G)\fP,
  112. \%\f3glTexParameter(3G)\fP