#include <samplerinstance.h>
Public Member Functions | |
Sampler2DArrayInstance (RenderService &renderService, const SamplerDeclaration &declaration, const Sampler2DArray *sampler2DArray, const SamplerChangedCallback &samplerChangedCallback) | |
bool | hasTexture (int index) const |
const Texture2D & | getTexture (int index) const |
void | setTexture (int index, Texture2D &texture) |
rtti::ObjectPtr< Texture2D > & | operator[] (size_t index) |
![]() | |
SamplerArrayInstance (RenderService &renderService, const SamplerDeclaration &declaration, const Sampler *sampler, const SamplerChangedCallback &samplerChangedCallback) | |
virtual | ~SamplerArrayInstance () |
virtual int | getNumElements () const |
![]() | |
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 | |
![]() | |
void | raiseChanged (int index=0) |
![]() | |
RenderService * | mRenderService = nullptr |
VkSampler | mVulkanSampler = VK_NULL_HANDLE |
const Sampler * | mSampler = nullptr |
const SamplerDeclaration * | mDeclaration = nullptr |
SamplerChangedCallback | mSamplerChangedCallback |
2D sampler array instance. Binds multiple 2D textures to a shader. The array can be changed at runtime.
Sampler2DArrayInstance | ( | RenderService & | renderService, |
const SamplerDeclaration & | declaration, | ||
const Sampler2DArray * | sampler2DArray, | ||
const SamplerChangedCallback & | samplerChangedCallback | ||
) |
Constructs the instance based on the shader declaration and resource.
renderService | render engine |
declaration | sampler shader declaration |
sampler2DArray | the sampler resource used to create this instance. |
samplerChangedCallback | called when the 'texture' changes. |
const Texture2D& getTexture | ( | int | index | ) | const |
index | the index to get the texture for. |
bool hasTexture | ( | int | index | ) | const |
rtti::ObjectPtr<Texture2D>& operator[] | ( | size_t | index | ) |
Array subscript operator, returns a specific texture in the array as a reference, making the following possible: mTextures[0] = myTexture
;
void setTexture | ( | int | index, |
Texture2D & | texture | ||
) |
Binds a texture at the given index
index | the index to bind the texture to |
texture | the texture to bind. |