C# Class NewTOAPIA.GL.GLTextureUnit

The GPU may have multiple texture units. By definition there is at least one, and in many cases there will be multiple. When a texture is 'bound', it is bound to a specific texture unit. TextureUnit0, is the default texture unit. In order to access a texture from within GLSL code, the texture is referenced based on the TextureUnit that it is bound to. So, for example, a texture that is bound to TextureUnit3 would be accessed in a sampler2D using the ordinal value '3'. The property 'OrdinalForShaders' gives this value.
Inheritance: IBindable
Mostrar archivo Open project: Wiladams/NewTOAPIA Class Usage Examples

Public Methods

Method Description
AssignTexture ( GLTexture2D aTexture ) : void
Bind ( ) : void
GetMaxTextureUnits ( GraphicsInterface gi ) : int
GetTextureUnit ( GraphicsInterface gi, TextureUnitID unitID ) : GLTextureUnit
Unbind ( ) : void

Private Methods

Method Description
GLTextureUnit ( GraphicsInterface gi, TextureUnitID unitID ) : System

Method Details

AssignTexture() public method

public AssignTexture ( GLTexture2D aTexture ) : void
aTexture GLTexture2D
return void

Bind() public method

public Bind ( ) : void
return void

GetMaxTextureUnits() public static method

public static GetMaxTextureUnits ( GraphicsInterface gi ) : int
gi GraphicsInterface
return int

GetTextureUnit() public static method

public static GetTextureUnit ( GraphicsInterface gi, TextureUnitID unitID ) : GLTextureUnit
gi GraphicsInterface
unitID TextureUnitID
return GLTextureUnit

Unbind() public method

public Unbind ( ) : void
return void