TDME2  1.9.200
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PostProcessingShaderBaseImplementation.cpp
Go to the documentation of this file.
1 #include <string>
2 
3 #include <tdme/tdme.h>
6 #include <tdme/engine/Engine.h>
7 
11 
12 PostProcessingShaderBaseImplementation::PostProcessingShaderBaseImplementation(Renderer* renderer)
13 {
14  this->renderer = renderer;
15  isRunning = false;
16  initialized = false;
17 }
18 
20 {
21  return initialized;
22 }
23 
25 {
26  // map inputs to attributes
30  }
31 
32  if (renderer->linkProgram(programId) == false)
33  return;
34 
35  // uniforms
42 
43  //
44  initialized = true;
45 }
46 
48 {
49  isRunning = true;
50  renderer->useProgram(contextIdx, programId);
56 }
57 
59 {
60  isRunning = false;
61 }
62 
63 void PostProcessingShaderBaseImplementation::setBufferPixelWidth(int contextIdx, float pixelWidth) {
66  }
67 }
68 
69 void PostProcessingShaderBaseImplementation::setBufferPixelHeight(int contextIdx, float pixelHeight) {
72  }
73 }
74 
76 }
77 
79 }
Engine main class.
Definition: Engine.h:131
virtual void setBufferPixelHeight(int contextIdx, float pixelHeight) override
Set source buffer pixel height.
virtual void setBufferPixelWidth(int contextIdx, float pixelWidth) override
Set source buffer pixel width.
virtual void setProgramAttributeLocation(int32_t programId, int32_t location, const string &name)=0
Bind attribute to a input location.
virtual void setProgramUniformInteger(int contextIdx, int32_t uniformId, int32_t value)=0
Set up a integer uniform value.
virtual bool linkProgram(int32_t programId)=0
Links attached shaders to a program.
void setLighting(int contextIdx, int32_t lighting)
Set current lighting model.
Definition: Renderer.h:504
virtual int32_t getProgramUniformLocation(int32_t programId, const string &name)=0
Returns location of given uniform variable.
virtual void useProgram(int contextIdx, int32_t programId)=0
Use shader program.
virtual void setProgramUniformFloat(int contextIdx, int32_t uniformId, float value)=0
Set up a float uniform value.