A texture copy effect. More...
Public Member Functions | |
TextureCopyEffect (System *system) noexcept | |
virtual | ~TextureCopyEffect () |
virtual EFFECT_TYPE | getType () const override |
nkGraphics::Texture * | getSourceTexture () const |
nkGraphics::Sampler * | getSourceSampler () const |
void | setSourceTexture (nkGraphics::Texture *value) |
void | setSourceSampler (nkGraphics::Sampler *value) |
virtual bool | load () override |
virtual void | unload () override |
Public Member Functions inherited from nkAstraeus::Effect | |
Effect (EFFECT_TYPE type) noexcept | |
virtual | ~Effect () |
nkMemory::StringView | getName () const |
nkGraphics::Shader * | getShader () const |
EFFECT_TYPE | getType () const |
void | setName (nkMemory::StringView value) |
Static Public Member Functions | |
static nkMemory::UniquePtr< TextureCopyEffect > | create (System *system=nullptr) |
A texture copy effect.
This effect is plain simple and will just take a texture on input, that it will fit into the rendering target.
Uses for such an effect could be to render a texture into a smaller target, or copy a texture into another one for a later use.
To help, some tweaking can be done about the way the texture will be sampled by providing a custom sampler to the effect.
|
noexcept |
Default constructor. Alternatively, see TextureCopyEffect::create(), or EffectManager::createOrRetrieve().
|
virtual |
Destructor. See EffectManager::erase().
|
overridevirtual |
nkGraphics::Texture* nkAstraeus::TextureCopyEffect::getSourceTexture | ( | ) | const |
nkGraphics::Sampler* nkAstraeus::TextureCopyEffect::getSourceSampler | ( | ) | const |
void nkAstraeus::TextureCopyEffect::setSourceTexture | ( | nkGraphics::Texture * | value | ) |
Sets the texture to use as an input to the effect.
value | The texture to use. |
void nkAstraeus::TextureCopyEffect::setSourceSampler | ( | nkGraphics::Sampler * | value | ) |
Overloads the sampler used to sample and copy the texture into the target. By default, the sampler used clamps the coordinates for sampling and uses point sampling.
value | The sampler to use, nullptr to reset to the default one. |
|
overridevirtual |
Loads the effect and make it ready for rendering.
Implements nkAstraeus::Effect.
|
overridevirtual |
Unloads the effect and its internal memory. After that, the effect is unusable for rendering.
Implements nkAstraeus::Effect.
|
static |
Creates an instance of the class, and returns ownership over it.
system | The system the resource should live in. If left to nullptr, will seek the singleton instance of the system. |