Gamedev Framework (gf)  0.9.0
A C++14 framework for 2D games
Public Member Functions | List of all members
gf::PostProcessing Class Reference

A post-processing drawable. More...

#include <gf/PostProcessing.h>

Inheritance diagram for gf::PostProcessing:
Inheritance graph

Public Member Functions

 PostProcessing ()
 Default constructor. More...
void setTexture (const Texture &texture)
 Set the source texture. More...
void setTextureRect (const RectF &textureRect)
 Set the texture rectangle. More...
void setEffect (Effect &effect)
 Set the effect to apply. More...
virtual void draw (RenderTarget &target, RenderStates states) override
 Draw the object to a render target. More...
- Public Member Functions inherited from gf::Drawable
virtual ~Drawable ()
 Virtual desctructor. More...

Detailed Description

A post-processing drawable.

This class is a light-weight object to apply a post-processing effect to a texture. The texture generally comes from a gf::RenderTexture.

See also

Constructor & Destructor Documentation

◆ PostProcessing()

gf::PostProcessing::PostProcessing ( )

Default constructor.

Member Function Documentation

◆ draw()

virtual void gf::PostProcessing::draw ( RenderTarget target,
RenderStates  states 

Draw the object to a render target.

This is a pure virtual function that has to be implemented by the derived class to define how the drawable should be drawn.

targetRender target to draw to
statesCurrent render states

Implements gf::Drawable.

◆ setEffect()

void gf::PostProcessing::setEffect ( Effect effect)

Set the effect to apply.

effectThe post-processing effect

◆ setTexture()

void gf::PostProcessing::setTexture ( const Texture texture)

Set the source texture.

textureThe source texture

◆ setTextureRect()

void gf::PostProcessing::setTextureRect ( const RectF textureRect)

Set the texture rectangle.

textureRectThe texture rectangle