TDME2 1.9.121
EZRShaderBaseImplementation.h
Go to the documentation of this file.
1#pragma once
2
3#include <tdme/tdme.h>
9
14
15/**
16 * Early z rejection shader base class
17 * @author Andreas Drewke
18 * @version $Id$
19 */
21{
22protected:
23 Renderer* renderer { nullptr };
24 int32_t vertexShaderId { -1 };
25 int32_t geometryShaderId { -1 };
26 int32_t fragmentShaderId {-1 };
27 int32_t programId { -1 };
29 int32_t uniformCameraMatrix { -1 };
30 int32_t uniformMVPMatrix { -1 };
31 int32_t uniformTextureMatrix { -1 };
38 int32_t uniformFrame { -1 };
39 bool initialized { false };
40
41public:
42 /**
43 * Constructor
44 * @param renderer renderer
45 */
47
48 /**
49 * Destructor
50 */
52
53 // overridden methods
54 virtual bool isInitialized() override;
55 virtual void initialize() override;
56 virtual void useProgram(Engine* engine, int contextIdx) override;
57 virtual void unUseProgram(int contextIdx) override;
58 virtual void updateMatrices(Renderer* renderer, int contextIdx) override;
59 virtual void updateTextureMatrix(Renderer* renderer, int contextIdx) override;
60 virtual void updateMaterial(Renderer* renderer, int contextIdx) override;
61 virtual void updateShaderParameters(Renderer* renderer, int contextIdx) override = 0;
62 virtual void bindTexture(Renderer* renderer, int contextIdx, int32_t textureId) override;
63
64};
Engine main class.
Definition: Engine.h:122
virtual void updateTextureMatrix(Renderer *renderer, int contextIdx) override
update texture matrix
virtual void updateMaterial(Renderer *renderer, int contextIdx) override
Update material.
virtual void updateMatrices(Renderer *renderer, int contextIdx) override
Update matrices.
virtual void initialize() override
Init EZR render shader program implementation.
virtual void bindTexture(Renderer *renderer, int contextIdx, int32_t textureId) override
Bind texture.
virtual void unUseProgram(int contextIdx) override
Unuse EZR render shader program.
virtual void useProgram(Engine *engine, int contextIdx) override
Use EZR render shader program.
virtual void updateShaderParameters(Renderer *renderer, int contextIdx) override=0
Update shader parameters.
4x4 3D Matrix class
Definition: Matrix4x4.h:24