Interface TextureBinder
-
- All Known Implementing Classes:
DefaultTextureBinder
public interface TextureBinderResponsible for binding textures, may implement a strategy to avoid binding a texture unnecessarily. A TextureBinder may decide to which texture unit it binds a texture.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidbegin()Prepares the binder for operation, must be matched with a call toend().intbind(TextureDescriptor textureDescriptor)Binds the texture to an available unit and applies the filters in the descriptor.intbind(GLTexture texture)Binds the texture to an available unit.voidend()Disables all used texture units and unbinds textures.intgetBindCount()intgetReuseCount()voidresetCounts()Resets the bind/reuse counts
-
-
-
Method Detail
-
begin
void begin()
Prepares the binder for operation, must be matched with a call toend().
-
end
void end()
Disables all used texture units and unbinds textures. Resets the counts.
-
bind
int bind(TextureDescriptor textureDescriptor)
Binds the texture to an available unit and applies the filters in the descriptor.- Parameters:
textureDescriptor- theTextureDescriptor- Returns:
- the unit the texture was bound to
-
bind
int bind(GLTexture texture)
Binds the texture to an available unit.- Parameters:
texture- theTexture- Returns:
- the unit the texture was bound to
-
getBindCount
int getBindCount()
- Returns:
- the number of binds actually executed since the last call to
resetCounts()
-
getReuseCount
int getReuseCount()
- Returns:
- the number of binds that could be avoided by reuse
-
resetCounts
void resetCounts()
Resets the bind/reuse counts
-
-