All Classes Files Functions Variables Typedefs Pages
IndexSet.hpp
1 #pragma once
2 
3 #include "IndexSlot.hpp"
4 #include "GLException.hpp"
5 #include "GLObject.hpp"
6 #include "VertexSeq.fpp"
7 #include "../config/BaseProxy.hpp"
8 
9 
10 namespace lumina {
11 namespace internal {
12 
13 class IndexSet : public GLObject {
14 public:
15  IndexSet(int indexCount) : m_buffer(nullptr), m_indexCount(indexCount) {}
16 
17  IndexSlot operator[](int index) {
18  if(index >= m_indexCount) {
19  logError("[IndexSet] Index <", index, "> out of bounds!");
20  throw GLException("[IndexSet] Index out of bounds");
21  }
22  return std::move(IndexSlot(*(m_buffer + index)));
23  }
24 
25 private:
26  unsigned int* m_buffer;
27  int m_indexCount;
28 
29  friend HotVertexSeqBase;
30 };
31 
32 }
33 }
Definition: IndexSlot.hpp:10
Definition: HotVertexSeq.hpp:20
Definition: GLException.hpp:7
Definition: GLObject.hpp:37
Definition: IndexSet.hpp:13