Home -> IStateContainer -> BindTexture

Description

The BindTexture method sets up a binding to an ITextureBuffer object, for use with a separately bound ITextureSampler.

ImportantImportant

In order to bind textures and samplers separately, the SeparateTextureSamplers feature must be supported on the IGraphicsDevice, and activated when the CreateRenderer method is called.

WarningWarning

Separate texture samplers are supported by all underlying rendering APIs other than OpenGL. If you care about OpenGL support, you must not use separate texture samplers. The BindTextureWithCombinedSampler method is portable across all renderers, and provides the same functionality as separate texture samplers, with the restriction that each separately bound texture requires the sampler to be bound with it. ITextureSampler objects can still be shared between textures even when they are bound separately, so unless you have a case where there is a significant advantage to separately binding samplers, it is recommended to use combined image samplers.

Usage

void BindTexture(TextureId textureId, ITextureBuffer1D* texture);
void BindTexture(TextureId textureId, ITextureBuffer2D* texture);
void BindTexture(TextureId textureId, ITextureBuffer3D* texture);
void BindTexture(TextureId textureId, ITextureBufferCube* texture);
void BindTexture(TextureId textureId, ITextureBuffer1DArray* texture);
void BindTexture(TextureId textureId, ITextureBuffer2DArray* texture);
void BindTexture(TextureId textureId, ITextureBufferCubeArray* texture);

Argument list

textureId [TextureId]
The TextureId of the named texture object to bind
texture [ITextureBuffer*]
The ITextureBuffer to bind

See also