TDME2  1.9.200
TransparentRenderPointsPool.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <vector>
4 
5 #include <tdme/tdme.h>
7 #include <tdme/engine/Color4.h>
10 #include <tdme/math/fwd-tdme.h>
12 #include <tdme/utilities/Console.h>
13 
14 using std::vector;
15 
20 
21 /**
22  * Transparent render points pool
23  * @author andreas.drewke
24  */
26 {
28 
29 private:
30  vector<TransparentRenderPoint*> transparentRenderPoints;
31  int32_t poolIdx;
32 
33 public:
34  // forbid class copy
36 
37  /**
38  * Public constructor
39  * @param pointsMax points max
40  */
41  TransparentRenderPointsPool(int32_t pointsMax);
42 
43  /**
44  * Destructor
45  */
47 
48  /**
49  * Creates an transparent render point entity in pool
50  * @param point point
51  * @param spriteIndex sprite index
52  * @param color color
53  * @param particleSystemType particle system type
54  * @param particleSystem particle system
55  */
56  inline void addPoint(const Vector3& point, uint16_t spriteIndex, const Color4& color, int particleSystemType, void* particleSystem) {
57  // check for pool overflow
58  if (poolIdx >= transparentRenderPoints.size()) {
59  Console::println(string("TransparentRenderPointsPool::createTransparentRenderPoint(): Too many transparent render points"));
60  return;
61  }
62  // create point in pool
63  auto transparentRenderPoint = transparentRenderPoints[poolIdx++];
64  transparentRenderPoint->point = point;
65  transparentRenderPoint->spriteIndex = spriteIndex;
66  transparentRenderPoint->color = color;
67  transparentRenderPoint->particleSystemType = particleSystemType;
68  transparentRenderPoint->particleSystem = particleSystem;
69  }
70 
71  /**
72  * Reset
73  */
74  inline void reset() {
75  poolIdx = 0;
76  }
77 
78  /**
79  * @return transparent render points count
80  */
82  return poolIdx;
83  }
84 
85  /**
86  * @return transparent render points vector
87  */
88  inline const vector<TransparentRenderPoint*>& getTransparentRenderPoints() {
90  }
91 
92  /**
93  * Sort transparent render points
94  */
95  void sort();
96 
97 };
Color 4 definition class.
Definition: Color4.h:18
void addPoint(const Vector3 &point, uint16_t spriteIndex, const Color4 &color, int particleSystemType, void *particleSystem)
Creates an transparent render point entity in pool.
const vector< TransparentRenderPoint * > & getTransparentRenderPoints()
Vector3 class representing vector3 mathematical structure and operations with x, y,...
Definition: Vector3.h:20
Console class.
Definition: Console.h:29
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6