API Documentation
Public Member Functions | Static Public Member Functions | List of all members
nkAstraeus::TextureCopyEffect Class Referencefinal

A texture copy effect. More...

Inheritance diagram for nkAstraeus::TextureCopyEffect:
nkAstraeus::Effect

Public Member Functions

 TextureCopyEffect (System *system) noexcept
 
virtual ~TextureCopyEffect ()
 
virtual EFFECT_TYPE getType () const override
 
nkGraphics::TexturegetSourceTexture () const
 
nkGraphics::SamplergetSourceSampler () 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::ShadergetShader () const
 
EFFECT_TYPE getType () const
 
void setName (nkMemory::StringView value)
 

Static Public Member Functions

static nkMemory::UniquePtr< TextureCopyEffectcreate (System *system=nullptr)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ TextureCopyEffect()

nkAstraeus::TextureCopyEffect::TextureCopyEffect ( System system)
noexcept

Default constructor. Alternatively, see TextureCopyEffect::create(), or EffectManager::createOrRetrieve().

◆ ~TextureCopyEffect()

virtual nkAstraeus::TextureCopyEffect::~TextureCopyEffect ( )
virtual

Destructor. See EffectManager::erase().

Member Function Documentation

◆ getType()

virtual EFFECT_TYPE nkAstraeus::TextureCopyEffect::getType ( ) const
overridevirtual
Returns
The effect type, TEXTURE_COPY in this case.

◆ getSourceTexture()

nkGraphics::Texture* nkAstraeus::TextureCopyEffect::getSourceTexture ( ) const
Returns
The texture used as input by the effect.

◆ getSourceSampler()

nkGraphics::Sampler* nkAstraeus::TextureCopyEffect::getSourceSampler ( ) const
Returns
The sampler used by the effec if it has been overloaded, nullptr else.

◆ setSourceTexture()

void nkAstraeus::TextureCopyEffect::setSourceTexture ( nkGraphics::Texture value)

Sets the texture to use as an input to the effect.

Parameters
valueThe texture to use.

◆ setSourceSampler()

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.

Parameters
valueThe sampler to use, nullptr to reset to the default one.
Remarks
This parameter can be updated even after the effect has been loaded, without needing to reload it.

◆ load()

virtual bool nkAstraeus::TextureCopyEffect::load ( )
overridevirtual

Loads the effect and make it ready for rendering.

Returns
Whether the loading went well (true) or not (false).

Implements nkAstraeus::Effect.

◆ unload()

virtual void nkAstraeus::TextureCopyEffect::unload ( )
overridevirtual

Unloads the effect and its internal memory. After that, the effect is unusable for rendering.

Implements nkAstraeus::Effect.

◆ create()

static nkMemory::UniquePtr<TextureCopyEffect> nkAstraeus::TextureCopyEffect::create ( System system = nullptr)
static

Creates an instance of the class, and returns ownership over it.

Parameters
systemThe system the resource should live in. If left to nullptr, will seek the singleton instance of the system.
Returns
Ownership over the created instance of the class.
Remarks
The instance is not part of any manager if instantiated this way. If the resource's lifetime should be managed within the manager, then calling ComplexEffectManager::createOrRetrieve() might be a better option. Alternatively, registering it afterwards through ComplexEffectManager::record() is another option.

The documentation for this class was generated from the following file: