Vigilante Game Framework  1.0.0.8
A 2D/3D C++ Game Framework using SFML.
Public Member Functions | Protected Attributes | List of all members
VPostEffectMultipass Class Reference

Special class that allows the application of multiple Post Effects, and enable/disable specific ones at runtime. More...

#include <VPostEffect.h>

Inheritance diagram for VPostEffectMultipass:
VPostEffectBase

Public Member Functions

 VPostEffectMultipass (int MaxSize)
 
void AddPostEffect (VPostEffectBase *post)
 
void RemovePostEffect (unsigned int index)
 
VPostEffectBaseGetPostEffect (unsigned int index)
 
void EnableEffect (unsigned int index, bool enable)
 
virtual void Apply (const sf::Texture &input, sf::RenderTarget &output)
 
virtual void Update (float dt)
 

Protected Attributes

std::vector< VPostEffectBase * > postEffects
 List of post process effects.
 
std::vector< bool > enabled
 List to determine which post effects are enabled.
 
std::vector< std::unique_ptr< sf::RenderTexture > > renderTextures
 List of render textures to apply post effects to.
 
unsigned int maxSize = 0
 The fixed size of post process effects.
 

Additional Inherited Members

- Static Public Member Functions inherited from VPostEffectBase
static bool isSupported ()
 
- Static Protected Member Functions inherited from VPostEffectBase
static void applyShader (const sf::Shader &shader, sf::RenderTarget &output)
 
static void passThrough (const sf::Texture &input, sf::RenderTarget &output)
 

Detailed Description

Special class that allows the application of multiple Post Effects, and enable/disable specific ones at runtime.

Constructor & Destructor Documentation

◆ VPostEffectMultipass()

VPostEffectMultipass::VPostEffectMultipass ( int  MaxSize)
Parameters
MaxSizeThe fixed amount of shaders the multipass can have.

Member Function Documentation

◆ AddPostEffect()

void VPostEffectMultipass::AddPostEffect ( VPostEffectBase post)
Parameters
postThe Post Effect to add.

◆ Apply()

virtual void VPostEffectMultipass::Apply ( const sf::Texture &  input,
sf::RenderTarget &  output 
)
virtual

Apply post effect from an input RenderTexture to an output RenderTarget (which may be a RenderTexture or Window).

Parameters
inputThe texture to pass through.
outputThe render target (Whether it's a RenderTexture or RenderWindow) to apply the shader to.

Implements VPostEffectBase.

◆ EnableEffect()

void VPostEffectMultipass::EnableEffect ( unsigned int  index,
bool  enable 
)

Enable/disable effect at index.

Parameters
indexThe index of the post effect list to remove.
enableEnables the post effect if true, else disable it.

◆ GetPostEffect()

VPostEffectBase* VPostEffectMultipass::GetPostEffect ( unsigned int  index)
Parameters
indexThe index of the post effect list to remove.
Returns
If index is valid, then returns the post effect.

◆ RemovePostEffect()

void VPostEffectMultipass::RemovePostEffect ( unsigned int  index)
Parameters
indexThe index of the post effect list to remove.

◆ Update()

virtual void VPostEffectMultipass::Update ( float  dt)
virtual

Updates all post effects currently enabled.

Parameters
dtDelta Time between the previous and current frame.

Reimplemented from VPostEffectBase.


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