bindTextureRepresentation(toCGLContext:textureUnit:normalizeCoordinates:)
Binds the texture to a given texture unit and optionally scales or flips the texture.
Declaration
func bindTextureRepresentation(toCGLContext cgl_ctx: CGLContextObj!, textureUnit unit: GLenum, normalizeCoordinates flag: Bool)Parameters
- cgl_ctx:
The CGL context to render to.)
- unit:
The texture unit to bind to (such as,
GL_TEXTURE0) - flag:
To apply a texture matrix to scale coordinates (from
[0, pixels]to[0,1]) and flip them vertically (if necessary), pass True.
Discussion
When you no longer need the texture, call unbindTextureRepresentation(fromCGLContext:textureUnit:).