TDME2 1.9.121
LinesShader.h
Go to the documentation of this file.
1#pragma once
2
3#include <tdme/tdme.h>
9
13
14/**
15 * Lines shader program
16 * @author Andreas Drewke
17 * @version $Id$
18 */
20{
21private:
22 int32_t renderProgramId { -1 };
23 int32_t renderFragmentShaderId { -1 };
24 int32_t renderVertexShaderId { -1 };
25 int32_t uniformMVPMatrix { -1 };
27 int32_t uniformEffectColorMul { -1 };
28 int32_t uniformEffectColorAdd { -1 };
32 Engine* engine { nullptr };
33 Renderer* renderer { nullptr };
34
35public:
36 /**
37 * Public constructor
38 * @param engine engine
39 * @param renderer renderer
40 */
42
43 /**
44 * @return initialized and ready to be used
45 */
46 bool isInitialized();
47
48 /**
49 * Initialize renderer
50 */
51 void initialize();
52
53 /**
54 * Use lighting program
55 * @param contextIdx context index
56 */
57 void useProgram(int contextIdx);
58
59 /**
60 * Update effect to program
61 * @param renderer renderer
62 * @param contextIdx context index
63 */
64 void updateEffect(int contextIdx);
65
66 /**
67 * Unuse particles shader program
68 * @param contextIdx context index
69 */
70 void unUseProgram(int contextIdx);
71
72 /**
73 * Update matrices to program
74 * @param renderer renderer
75 * @param contextIdx context index
76 */
77 void updateMatrices(int contextIdx);
78
79 /**
80 * Set parameters
81 * @param contextIdx context index
82 * @param textureId texture id
83 * @param lineWidth line width
84 */
85 void setParameters(int contextIdx, int32_t textureId, float lineWidth);
86
87};
Engine main class.
Definition: Engine.h:122
void updateMatrices(int contextIdx)
Update matrices to program.
void updateEffect(int contextIdx)
Update effect to program.
Definition: LinesShader.cpp:85
void unUseProgram(int contextIdx)
Unuse particles shader program.
Definition: LinesShader.cpp:95
void setParameters(int contextIdx, int32_t textureId, float lineWidth)
Set parameters.
LinesShader(Engine *engine, Renderer *renderer)
Public constructor.
Definition: LinesShader.cpp:15
void useProgram(int contextIdx)
Use lighting program.
Definition: LinesShader.cpp:77
4x4 3D Matrix class
Definition: Matrix4x4.h:24