TDME2  1.9.200
PostProcessingShader.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <unordered_map>
5 
6 #include <tdme/tdme.h>
7 #include <tdme/engine/fwd-tdme.h>
10 
11 using std::string;
12 using std::unordered_map;
13 
17 
18 /**
19  * Post processing shader
20  * @author Andreas Drewke
21  */
23 {
24 private:
25  unordered_map<string, PostProcessingShaderImplementation*> shaders;
27 
28  bool running { false };
29 
30 public:
31  // forbid class copy
33 
34  /**
35  * Public constructor
36  * @param renderer renderer
37  */
38  PostProcessingShader(Renderer* renderer);
39 
40  /**
41  * Public destructor
42  */
44 
45  /**
46  * @return initialized and ready to be used
47  */
48  bool isInitialized();
49 
50  /**
51  * Initialize
52  */
53  void initialize();
54 
55  /**
56  * Initialize
57  */
58  void dispose();
59 
60  /**
61  * Use program
62  */
63  void useProgram();
64 
65  /**
66  * Unuse program
67  */
68  void unUseProgram();
69 
70  /**
71  * Has post processing shader
72  * @param id shader id
73  * @return if shader exists and is initialized
74  */
75  bool hasShader(const string& id);
76 
77  /**
78  * Set post processing shader
79  * @param contextIdx context index
80  */
81  void setShader(int contextIdx, const string& id);
82 
83  /**
84  * Set source buffer pixel width
85  * @param contextIdx context index
86  * @param pixelWidth pixel width
87  */
88  void setBufferPixelWidth(int contextIdx, float pixelWidth);
89 
90  /**
91  * Set source buffer pixel height
92  * @param contextIdx context index
93  * @param pixelHeight pixel height
94  */
95  void setBufferPixelHeight(int contextIdx, float pixelHeight);
96 
97  /**
98  * Set shader parameters
99  * @param engine engine
100  */
101  void setShaderParameters(int contextIdx, Engine* engine);
102 
103  /**
104  * Load textures
105  * @param pathName path name
106  */
107  void loadTextures(const string& pathName);
108 
109 };
Engine main class.
Definition: Engine.h:131
Frame buffer class.
Definition: FrameBuffer.h:22
void setShader(int contextIdx, const string &id)
Set post processing shader.
void setBufferPixelWidth(int contextIdx, float pixelWidth)
Set source buffer pixel width.
unordered_map< string, PostProcessingShaderImplementation * > shaders
bool hasShader(const string &id)
Has post processing shader.
void setShaderParameters(int contextIdx, Engine *engine)
Set shader parameters.
void setBufferPixelHeight(int contextIdx, float pixelHeight)
Set source buffer pixel height.
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6