#include <samplerinstance.h>
Public Member Functions | |
Sampler2DInstance (RenderService &renderService, const SamplerDeclaration &declaration, const Sampler2D *sampler2D, const SamplerChangedCallback &samplerChangedCallback) | |
void | setTexture (Texture2D &texture) |
bool | hasTexture () const |
const Texture2D & | getTexture () 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 instance. Binds a single 2D texture to a shader. The texture can be changed at runtime.
Sampler2DInstance | ( | RenderService & | renderService, |
const SamplerDeclaration & | declaration, | ||
const Sampler2D * | sampler2D, | ||
const SamplerChangedCallback & | samplerChangedCallback | ||
) |
Constructs the instance based on the shader declaration and resource.
renderService | render engine |
declaration | sampler shader declaration |
sampler2D | the sampler resource used to create this instance. |
samplerChangedCallback | called when the 'texture' changes. |
const Texture2D& getTexture | ( | ) | const |
bool hasTexture | ( | ) | const |
void setTexture | ( | Texture2D & | texture | ) |
Binds a texture to the 2D sampler.
texture | the new texture to bind |