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

A basic Post Processing effect that uses a single shader object and allows setting different kinds of Uniform parameters. More...

#include <VPostEffect.h>

Inheritance diagram for VPostEffect:
VPostEffectBase

Public Member Functions

 VPostEffect (const sf::String &filename, sf::Shader::Type type)
 
 VPostEffect (const sf::String &vertFile, const sf::String &fragFile)
 
 VPostEffect (const sf::String &vertFile, const sf::String &geomFile, const sf::String &fragFile)
 
void SetInputTextureName (const sf::String &name)
 
void SetParameter (const sf::String &paramName, sf::Shader::CurrentTextureType currentTextureType)
 
void SetParameter (const sf::String &paramName, const sf::Texture &texture)
 
void SetParameter (const sf::String &paramName, const sf::Transform &transform)
 
void SetParameter (const sf::String &paramName, const sf::Color &colour)
 
void SetParameter (const sf::String &paramName, const sf::Vector3f &vec3)
 
void SetParameter (const sf::String &paramName, const sf::Vector2f &vec2)
 
void SetParameter (const sf::String &paramName, float x, float y, float z, float w)
 
void SetParameter (const sf::String &paramName, float x, float y, float z)
 
void SetParameter (const sf::String &paramName, float x, float y)
 
void SetParameter (const sf::String &paramName, float x)
 
virtual void Apply (const sf::Texture &input, sf::RenderTarget &output)
 
- Public Member Functions inherited from VPostEffectBase
virtual void Update (float dt)
 

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

A basic Post Processing effect that uses a single shader object and allows setting different kinds of Uniform parameters.

Constructor & Destructor Documentation

◆ VPostEffect() [1/3]

VPostEffect::VPostEffect ( const sf::String &  filename,
sf::Shader::Type  type 
)
Parameters
filenameFile path and name of shader file.
typeThe Type of shader.

◆ VPostEffect() [2/3]

VPostEffect::VPostEffect ( const sf::String &  vertFile,
const sf::String &  fragFile 
)
Parameters
vertFileFile path and name of the vertex shader file.
fragFileFile path and name of the fragment shader file.

◆ VPostEffect() [3/3]

VPostEffect::VPostEffect ( const sf::String &  vertFile,
const sf::String &  geomFile,
const sf::String &  fragFile 
)
Parameters
vertFileFile path and name of the vertex shader file.
geomFileFile path and name of the geometry shader file.
fragFileFile path and name of the fragment shader file.

Member Function Documentation

◆ Apply()

virtual void VPostEffect::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.

◆ SetInputTextureName()

void VPostEffect::SetInputTextureName ( const sf::String &  name)
Parameters
nameThe name for the Input Texture (the default texture assuming no texture is set to the Uniform variable).

◆ SetParameter() [1/10]

void VPostEffect::SetParameter ( const sf::String &  paramName,
sf::Shader::CurrentTextureType  currentTextureType 
)

Sets Texture Type Parameter.

Parameters
paramNameThe name of the uniform parameter.
currentTextureTypeSpecial type that represents the texture of the object being drawn.

◆ SetParameter() [2/10]

void VPostEffect::SetParameter ( const sf::String &  paramName,
const sf::Texture &  texture 
)

Sets Texture Parameter.

Parameters
paramNameThe name of the uniform parameter.
textureThe texture to use for texture.

◆ SetParameter() [3/10]

void VPostEffect::SetParameter ( const sf::String &  paramName,
const sf::Transform &  transform 
)

Sets Transform Parameter.

Parameters
paramNameThe name of the uniform parameter.
transformThe transform matrix to set.

◆ SetParameter() [4/10]

void VPostEffect::SetParameter ( const sf::String &  paramName,
const sf::Color &  colour 
)

Sets Colour (Vec4) Parameter

Parameters
paramNameThe name of the uniform parameter.
colourThe colour that will be converted to Vec4.

◆ SetParameter() [5/10]

void VPostEffect::SetParameter ( const sf::String &  paramName,
const sf::Vector3f &  vec3 
)

Sets Vec3 Parameter

Parameters
paramNameThe name of the uniform parameter.
vec3The Vector3f that will be converted to Vec3.

◆ SetParameter() [6/10]

void VPostEffect::SetParameter ( const sf::String &  paramName,
const sf::Vector2f &  vec2 
)

Sets Vec2 Parameter

Parameters
paramNameThe name of the uniform parameter.
vec2The Vector3f that will be converted to Vec2.

◆ SetParameter() [7/10]

void VPostEffect::SetParameter ( const sf::String &  paramName,
float  x,
float  y,
float  z,
float  w 
)

Sets Vec4 Parameter from individual floats.

Parameters
paramNameThe name of the uniform parameter.
xX coordinate.
yY coordinate.
zZ coordinate.
wW coordinate.

◆ SetParameter() [8/10]

void VPostEffect::SetParameter ( const sf::String &  paramName,
float  x,
float  y,
float  z 
)

Sets Vec3 Parameter from individual floats.

Parameters
paramNameThe name of the uniform parameter.
xX coordinate.
yY coordinate.
zZ coordinate.

◆ SetParameter() [9/10]

void VPostEffect::SetParameter ( const sf::String &  paramName,
float  x,
float  y 
)

Sets Vec2 Parameter from individual floats.

Parameters
paramNameThe name of the uniform parameter.
xX coordinate.
yY coordinate.

◆ SetParameter() [10/10]

void VPostEffect::SetParameter ( const sf::String &  paramName,
float  x 
)

Sets float parameter.

Parameters
paramNameThe name of the uniform parameter.
xFloat value.

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