TDME2  1.9.200
Texture2DRenderShader.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <tdme/tdme.h>
4 #include <tdme/engine/fwd-tdme.h>
7 #include <tdme/math/Vector2.h>
8 
10 
13 
14 /**
15  * Texture 2D render shader
16  * @author Andreas Drewke
17  */
19 {
20 
21 private:
22  Renderer* renderer { nullptr };
23  int32_t vertexShaderId { -1 };
24  int32_t fragmentShaderId { -1 };
25  int32_t programId { -1 };
26  int32_t uniformTextureUnit { -1 };
27  int32_t vboVertices { -1 };
28  int32_t vboTextureCoordinates {-1 };
30  bool isRunning;
31 
32 public:
33  // forbid class copy
35 
36  /**
37  * Public constructor
38  * @param renderer renderer
39  */
41 
42  /**
43  * Public destructor
44  */
46 
47  /**
48  * @return if initialized and ready to use
49  */
50  bool isInitialized();
51 
52  /**
53  * Initialize
54  */
55  void initialize();
56 
57  /**
58  * Dispose
59  */
60  void dispose();
61 
62  /**
63  * Use render program
64  */
65  void useProgram();
66 
67  /**
68  * Un use render program
69  */
70  void unUseProgram();
71 
72  /**
73  * Render texture
74  * @param engine engine to use
75  * @param position 2D position on screen
76  * @param dimension 2D dimenson on screen
77  * @param textureId texture id
78  * @param width optional render target width
79  * @param height optional render target height
80  */
81  void renderTexture(Engine* engine, const Vector2& position, const Vector2& dimension, int textureId, int width = -1, int height = -1);
82 
83 };
Engine main class.
Definition: Engine.h:131
void renderTexture(Engine *engine, const Vector2 &position, const Vector2 &dimension, int textureId, int width=-1, int height=-1)
Render texture.
Vector2 class representing vector2 mathematical structure and operations with x, y components.
Definition: Vector2.h:20
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6