TDME2  1.9.200
ShadowMapCreationShaderImplementation.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 
5 #include <tdme/tdme.h>
6 #include <tdme/engine/fwd-tdme.h>
9 #include <tdme/math/fwd-tdme.h>
10 
11 using std::string;
12 
16 
17 /**
18  * Pre shadow mapping shader for create shadow map
19  * @author Andreas Drewke
20  */
22 {
23  /**
24  * Destructor
25  */
27 
28  /**
29  * @return shader id
30  */
31  virtual const string getId() = 0;
32 
33  /**
34  * @return if initialized and ready to use
35  */
36  virtual bool isInitialized() = 0;
37 
38  /**
39  * Init shadow map creation program
40  */
41  virtual void initialize() = 0;
42 
43  /**
44  * Use shadow map creation program
45  * @param engine engine
46  * @param contextIdx context index
47  */
48  virtual void useProgram(Engine* engine, int contextIdx) = 0;
49 
50  /**
51  * Unuse shadow map creation program
52  * @param contextIdx context index
53  */
54  virtual void unUseProgram(int contextIdx) = 0;
55 
56  /**
57  * Set up program matrices
58  * @param contextIdx context index
59  */
60  virtual void updateMatrices(int contextIdx) = 0;
61 
62  /**
63  * Set up program texture matrix
64  * @param renderer renderer
65  * @param contextIdx context index
66  */
67  virtual void updateTextureMatrix(Renderer* renderer, int contextIdx) = 0;
68 
69  /**
70  * Update material
71  * @param renderer renderer
72  * @param contextIdx context index
73  */
74  virtual void updateMaterial(Renderer* renderer, int contextIdx) = 0;
75 
76  /**
77  * Update shader parameters
78  * @param renderer renderer
79  * @param contextIdx context index
80  */
81  virtual void updateShaderParameters(Renderer* renderer, int contextIdx) = 0;
82 
83  /**
84  * Bind texture
85  * @param renderer renderer
86  * @param contextIdx context index
87  * @param textureId texture id
88  */
89  virtual void bindTexture(Renderer* renderer, int contextIdx, int32_t textureId) = 0;
90 
91  /**
92  * Unload textures
93  */
94  virtual void unloadTextures() = 0;
95 
96  /**
97  * Load textures
98  * @param pathName path name
99  */
100  virtual void loadTextures(const string& pathName) = 0;
101 
102 };
Engine main class.
Definition: Engine.h:131
Matrix4x4 class representing matrix4x4 mathematical structure and operations for 3d space.
Definition: Matrix4x4.h:23
virtual void loadTextures(const string &pathName)=0
Load textures.
virtual void updateTextureMatrix(Renderer *renderer, int contextIdx)=0
Set up program texture matrix.
virtual void unUseProgram(int contextIdx)=0
Unuse shadow map creation program.
virtual void updateShaderParameters(Renderer *renderer, int contextIdx)=0
Update shader parameters.
virtual void updateMatrices(int contextIdx)=0
Set up program matrices.
virtual void bindTexture(Renderer *renderer, int contextIdx, int32_t textureId)=0
Bind texture.
virtual void initialize()=0
Init shadow map creation program.
virtual void useProgram(Engine *engine, int contextIdx)=0
Use shadow map creation program.
virtual void updateMaterial(Renderer *renderer, int contextIdx)=0
Update material.