TDME2  1.9.200
VBOManager_VBOManaged.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <string>
4 #include <vector>
5 
6 #include <tdme/tdme.h>
8 
9 using std::string;
10 using std::vector;
11 
13 
14 /**
15  * Managed VBO entity
16  * @author Andreas Drewke
17  */
19 {
20  friend class VBOManager;
21 
22 private:
23  string id;
24  vector<int32_t> vboIds;
25  int32_t referenceCounter { 0 };
26  volatile bool uploaded { false };
27 
28  /**
29  * Private constructor
30  * @param id id
31  * @param vboIds VBO ids
32  */
33  VBOManager_VBOManaged(const string& id, vector<int32_t>& vboIds);
34 
35 public:
36  // forbid class copy
38 
39  /**
40  * @return vbo id
41  */
42  inline const string& getId() {
43  return id;
44  }
45 
46  /**
47  * @return vbo gl ids
48  */
49  inline vector<int32_t>* getVBOIds() {
50  return &vboIds;
51  }
52 
53  /**
54  * @return reference counter
55  */
56  inline int32_t getReferenceCounter() {
57  return referenceCounter;
58  }
59 
60 private:
61  /**
62  * decrement reference counter
63  * @return if reference counter = 0
64  */
65  inline bool decrementReferenceCounter() {
67  return referenceCounter == 0;
68  }
69 
70  /**
71  * increment reference counter
72  */
73  inline void incrementReferenceCounter() {
75  }
76 
77 public:
78 
79  /**
80  * Set uploaded
81  * @param uploaded uploaded
82  */
83  inline void setUploaded(bool uploaded) {
84  this->uploaded = uploaded;
85  }
86 
87  /**
88  * @return if vbo's have been uploaded
89  */
90  inline bool isUploaded() {
91  return uploaded;
92  }
93 
94 };
VBOManager_VBOManaged(const string &id, vector< int32_t > &vboIds)
Private constructor.
#define FORBID_CLASS_COPY(CLASS)
Definition: tdme.h:6