GlobeEngine
BaseBuffer.h
Go to the documentation of this file.
1 
15 #ifndef GlobeEngine_BaseBuffer_h
16 #define GlobeEngine_BaseBuffer_h
17 
18 #include "OpenGL_Includes.h"
19 
20 namespace ge {
21  template <int TYPE> class BaseBuffer
22  {
23  public:
24  static BaseBuffer& instance()
25  {
26  static BaseBuffer _instance;
27  return _instance;
28  }
30 
31  void bindBufferBase(unsigned int _baseLayer, GLuint _bufferHandle) const {
32  glBindBufferBase(TYPE, _baseLayer, _bufferHandle);
33  }
34 
35  void unbindBufferBase(unsigned int _baseLayer) const {
36  glBindBufferBase(TYPE, _baseLayer, 0);
37  }
38 
39  /*void unbindBufferBases() {
40  for (unsigned int i = 0; i < bufferHandleCount; i++) {
41  glBindBufferBase(TYPE, i, 0);
42  }
43  }*/
44 
45  private:
46  // verhindert, dass ein Objekt von außerhalb von N erzeugt wird.
47  // protected, wenn man von der Klasse noch erben möchte
48  BaseBuffer() {}
49  /* verhindert, dass eine weitere Instanz via Kopier-Konstruktor erstellt werden kann */
50  BaseBuffer(const BaseBuffer&);
51  //Verhindert weitere Instanz durch Kopie
52  BaseBuffer & operator = (const BaseBuffer &);
53  };
54 
55 #ifndef GENGINE_GL_ES
58 #endif
59 
60 #ifndef GENGINE_GL_BELOW_410
63 #endif
64 
65 
66 
67 }
68 #endif
void unbindBufferBase(unsigned int _baseLayer) const
Definition: BaseBuffer.h:35
void bindBufferBase(unsigned int _baseLayer, GLuint _bufferHandle) const
Definition: BaseBuffer.h:31
BaseBuffer< GL_UNIFORM_BUFFER > UniformBaseBuffer
Definition: BaseBuffer.h:56
BaseBuffer< GL_TRANSFORM_FEEDBACK_BUFFER > TransformFeedbackBaseBuffer
Definition: BaseBuffer.h:57
BaseBuffer< GL_SHADER_STORAGE_BUFFER > ShaderStorageBaseBuffer
Definition: BaseBuffer.h:62
~BaseBuffer()
Definition: BaseBuffer.h:29
Definition: BaseBuffer.h:21
static BaseBuffer & instance()
Definition: BaseBuffer.h:24
BaseBuffer< GL_ATOMIC_COUNTER_BUFFER > AtomicCounterBaseBuffer
Definition: BaseBuffer.h:61
Definition: AvalancheTrainingSimulationEngine.h:28