TDME2  1.9.200
LightingShaderImplementation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <array>
4 
5 #include <tdme/tdme.h>
6 #include <tdme/engine/fwd-tdme.h>
10 #include <tdme/math/fwd-tdme.h>
11 #include <tdme/math/Matrix4x4.h>
12 
13 using std::array;
14 
19 
20 /**
21  * Lighting shader implementation interface
22  * @author Andreas Drewke
23  */
25 {
26  /**
27  * Destructor
28  */
30 
31  /**
32  * @return shader id
33  */
34  virtual const string getId() = 0;
35 
36  /**
37  * @return initialized and ready to be used
38  */
39  virtual bool isInitialized() = 0;
40 
41  /**
42  * Initialize renderer
43  */
44  virtual void initialize() = 0;
45 
46  /**
47  * Register shader
48  */
49  virtual void registerShader() = 0;
50 
51  /**
52  * Use lighting program
53  * @param engine engine
54  * @param contextIdx context index
55  */
56  virtual void useProgram(Engine* engine, int contextIdx) = 0;
57 
58  /**
59  * Unuse lighting program
60  * @param contextIdx context index
61  */
62  virtual void unUseProgram(int contextIdx) = 0;
63 
64  /**
65  * Update effect to program
66  * @param renderer renderer
67  * @param contextIdx context index
68  */
69  virtual void updateEffect(Renderer* renderer, int contextIdx) = 0;
70 
71  /**
72  * Update material to program
73  * @param renderer renderer
74  * @param contextIdx context index
75  */
76  virtual void updateMaterial(Renderer* renderer, int contextIdx) = 0;
77 
78  /**
79  * Update light to program
80  * @param renderer renderer
81  * @param contextIdx context index
82  * @param lightId light id
83  */
84  virtual void updateLight(Renderer* renderer, int contextIdx, int32_t lightId) = 0;
85 
86  /**
87  * Update matrices to program
88  * @param renderer renderer
89  * @param contextIdx context index
90  */
91  virtual void updateMatrices(Renderer* renderer, int contextIdx) = 0;
92 
93  /**
94  * Update texture matrix to program
95  * @param renderer renderer
96  * @param contextIdx context index
97  */
98  virtual void updateTextureMatrix(Renderer* renderer, int contextIdx) = 0;
99 
100  /**
101  * Update shader parameters
102  * @param renderer renderer
103  * @param context
104  */
105  virtual void updateShaderParameters(Renderer* renderer, int contextIdx) = 0;
106 
107  /**
108  * Bind texture
109  * @param renderer renderer
110  * @param contextIdx context index
111  * @param textureId texture id
112  */
113  virtual void bindTexture(Renderer* renderer, int contextIdx, int32_t textureId) = 0;
114 
115  /**
116  * Unload textures
117  */
118  virtual void unloadTextures() = 0;
119 
120  /**
121  * Load textures
122  * @param pathName path name
123  */
124  virtual void loadTextures(const string& pathName) = 0;
125 
126 };
Engine main class.
Definition: Engine.h:131
Matrix4x4 class representing matrix4x4 mathematical structure and operations for 3d space.
Definition: Matrix4x4.h:23
virtual void updateEffect(Renderer *renderer, int contextIdx)=0
Update effect to program.
virtual void loadTextures(const string &pathName)=0
Load textures.
virtual void updateTextureMatrix(Renderer *renderer, int contextIdx)=0
Update texture matrix to program.
virtual void unUseProgram(int contextIdx)=0
Unuse lighting program.
virtual void updateShaderParameters(Renderer *renderer, int contextIdx)=0
Update shader parameters.
virtual void updateLight(Renderer *renderer, int contextIdx, int32_t lightId)=0
Update light to program.
virtual void bindTexture(Renderer *renderer, int contextIdx, int32_t textureId)=0
Bind texture.
virtual void useProgram(Engine *engine, int contextIdx)=0
Use lighting program.
virtual void updateMaterial(Renderer *renderer, int contextIdx)=0
Update material to program.
virtual void updateMatrices(Renderer *renderer, int contextIdx)=0
Update matrices to program.