NAP
Public Member Functions | List of all members
SamplerCubeArrayInstance Class Reference

#include <samplerinstance.h>

Public Member Functions

 SamplerCubeArrayInstance (RenderService &renderService, const SamplerDeclaration &declaration, const SamplerCubeArray *samplerCubeArray, const SamplerChangedCallback &samplerChangedCallback)
 
bool hasTexture (int index) const
 
const TextureCube & getTexture (int index) const
 
void setTexture (int index, TextureCube &textureCube)
 
rtti::ObjectPtr< TextureCube > & operator[] (size_t index)
 
- Public Member Functions inherited from SamplerArrayInstance
 SamplerArrayInstance (RenderService &renderService, const SamplerDeclaration &declaration, const Sampler *sampler, const SamplerChangedCallback &samplerChangedCallback)
 
virtual ~SamplerArrayInstance ()
 
virtual int getNumElements () const
 
- Public Member Functions inherited from SamplerInstance
 SamplerInstance (RenderService &renderService, const SamplerDeclaration &declaration, const Sampler *sampler, const SamplerChangedCallback &samplerChangedCallback)
 
virtual ~SamplerInstance ()
 
bool init (utility::ErrorState &errorState)
 
const SamplerDeclaration & getDeclaration () const
 
VkSampler getVulkanSampler () const
 

Additional Inherited Members

- Protected Member Functions inherited from SamplerInstance
void raiseChanged (int index=0)
 
- Protected Attributes inherited from SamplerInstance
RenderService * mRenderService = nullptr
 
VkSampler mVulkanSampler = VK_NULL_HANDLE
 
const Sampler * mSampler = nullptr
 
const SamplerDeclaration * mDeclaration = nullptr
 
SamplerChangedCallback mSamplerChangedCallback
 

Description

Cube sampler array instance. Binds multiple cube textures to a shader. The array can be changed at runtime.

Inheritance diagram for SamplerCubeArrayInstance:
[legend]
Collaboration diagram for SamplerCubeArrayInstance:
[legend]

Constructor & Destructor Documentation

◆ SamplerCubeArrayInstance()

SamplerCubeArrayInstance ( RenderService &  renderService,
const SamplerDeclaration &  declaration,
const SamplerCubeArray *  samplerCubeArray,
const SamplerChangedCallback &  samplerChangedCallback 
)

Constructs the instance based on the shader declaration and resource.

Parameters
renderServicerender engine
declarationsampler shader declaration
samplerCubeArraythe sampler resource used to create this instance.
samplerChangedCallbackcalled when the 'texture' changes.

Member Function Documentation

◆ getTexture()

const TextureCube& getTexture ( int  index) const
Parameters
indexthe index to get the texture for.
Returns
the texture at the given index

◆ hasTexture()

bool hasTexture ( int  index) const
Returns
if a texture is bound to the given index.

◆ operator[]()

rtti::ObjectPtr<TextureCube>& operator[] ( size_t  index)

Array subscript operator, returns a specific texture in the array as a reference, making the following possible: mTextures[0] = myTexture;

Returns
a specific value in the array as a reference.

◆ setTexture()

void setTexture ( int  index,
TextureCube &  textureCube 
)

Binds a texture at the given index

Parameters
indexthe index to bind the texture to
textureCubethe texture to bind.