]> git.tdb.fi Git - libs/gl.git/blob - source/postprocessor.h
Some fixes to assignment management in UnusedVariableLocator
[libs/gl.git] / source / postprocessor.h
1 #ifndef MSP_GL_POSTPROCESSOR_H_
2 #define MSP_GL_POSTPROCESSOR_H_
3
4 namespace Msp {
5 namespace GL {
6
7 class Mesh;
8 class Renderer;
9 class Shader;
10 class Texture2D;
11
12 /**
13 Base class for post-processing effects.  Post-processors receive the contents
14 of the entire framebuffer as a texture and render it back, altering it in the
15 process.
16 */
17 class PostProcessor
18 {
19 protected:
20         PostProcessor() { }
21 public:
22         virtual ~PostProcessor() { }
23
24         /// Renders the effect.
25         virtual void render(const Texture2D &, const Texture2D &) { }
26
27         virtual void render(Renderer &, const Texture2D &, const Texture2D &);
28
29 protected:
30         /** Returns a vertex shader suitable for rendering a full-screen quad.
31         Input vertices are assumed to be in normalized device coordinates; no
32         transform is performed.  The shader provides a varying vec2 texcoord for
33         a fragment shader to access textures.
34         
35         Deprecated in favor of the builtin postprocess.glsl module. */
36         static Shader &get_fullscreen_vertex_shader();
37
38         /** Returns a mesh consisting of a single quad, covering the entire screen.
39         The vertices are in normalized device coordinates. */
40         static const Mesh &get_fullscreen_quad();
41
42 private:
43         static const Mesh &create_fullscreen_quad();
44 };
45
46 } // namespace GL
47 } // namespace Msp
48
49 #endif