26 typedef std::deque<GLuint> TFreeList;
30 TFreeList m_freeIndexBuffers;
31 TFreeList m_freeVertexBuffers;
33 int m_numOfAllocations;
36 int m_orphanedBufferSize;
38 bool m_canOrphanInitialised;
39 bool m_canOrphanBuffers;
41 void AllocateBuffers(TFreeList& freeBuffers);
43 void ReleaseBuffer(GLuint bufferId, GLint bufferType);
44 void OrphanBuffer(GLuint bufferId, GLint bufferType);
45 void DeleteBuffers(std::deque<GLuint>& toDelete);
46 void DeleteBuffer(GLuint bufferId);
47 GLuint AllocateBuffer(GLint bufferType,
size_t bufferSize,
const std::string& debugName);
49 bool DetermineCanOrphanBuffers(
int orphanedBufferSize)
const;
51 void AmortizedReleaseBuffers();
53 struct GLBufferDebugInfo
62 std::map<GLuint, GLBufferDebugInfo> m_debugInfo;
68 void Update(
float dt);
69 GLuint AllocateVertexBuffer(
size_t bufferSize,
const std::string& debugName);
70 GLuint AllocateIndexBuffer(
size_t bufferSize,
const std::string& debugName);
71 void ReleaseVertexBuffer(GLuint bufferId);
72 void ReleaseIndexBuffer(GLuint bufferId);
76 int GetNumOfAllocations()
const;
77 int GetNumOfReleases()
const;
79 int GetNumOfAllocated();
81 static std::string CreateDebugString(
const std::string& prefix,
int meshIndex,
const Streaming::MortonKey& mortonKey,
const std::string& materialName =
"");