2 #include "AssetManager.h" 3 #include <unordered_set> 7 class ParaVertexBuffer;
20 ATTRIBUTE_METHOD1(
ParaVertexBufferPool, GetFullSizedBufferSize_s,
int*) { *p1 = cls->GetFullSizedBufferSize();
return S_OK; }
21 ATTRIBUTE_METHOD1(
ParaVertexBufferPool, SetFullSizedBufferSize_s,
int) { cls->SetFullSizedBufferSize((uint32)p1);
return S_OK; }
23 ATTRIBUTE_METHOD1(
ParaVertexBufferPool, GetMaxPooledCount_s,
int*) { *p1 = cls->GetMaxPooledCount();
return S_OK; }
24 ATTRIBUTE_METHOD1(
ParaVertexBufferPool, SetMaxPooledCount_s,
int) { cls->SetMaxPooledCount((uint32)p1);
return S_OK; }
26 ATTRIBUTE_METHOD1(
ParaVertexBufferPool, GetActiveBufferCount_s,
int*) { *p1 = cls->GetActiveBufferCount();
return S_OK; }
27 ATTRIBUTE_METHOD1(
ParaVertexBufferPool, GetTotalBufferCount_s,
int*) { *p1 = cls->GetTotalBufferCount();
return S_OK; }
28 ATTRIBUTE_METHOD1(
ParaVertexBufferPool, GetTotalBufferBytes_s,
int*) { *p1 = cls->GetTotalBufferBytes();
return S_OK; }
32 uint32 GetFullSizedBufferSize()
const;
33 void SetFullSizedBufferSize(uint32 val);
34 uint32 GetMaxPooledCount()
const;
35 void SetMaxPooledCount(uint32 val);
36 size_t GetTotalBufferBytes(
bool bRecalculate=
false);
38 int GetActiveBufferCount()
const;
64 std::unordered_set<ParaVertexBuffer*> m_activeBuffers;
65 std::unordered_set<ParaVertexBuffer*> m_unusedFullSizedBuffers;
92 size_t GetVertexBufferPoolTotalBytes();
an attribute class is a collection of attribute fields.
Definition: AttributeClass.h:10
void TickCache()
called between render tick to release some cached pool object if needed.
Definition: ParaVertexBufferPool.cpp:112
different physics engine has different winding order.
Definition: EventBinding.h:32
pool of vertex buffer object.
Definition: ParaVertexBufferPool.h:10
cross platform vertex/index buffer.
Definition: ParaVertexBuffer.h:18
virtual void Cleanup()
clear all pooled objects.
Definition: ParaVertexBufferPool.cpp:64
virtual int InstallFields(CAttributeClass *pClass, bool bOverride)
this class should be implemented if one wants to add new attribute.
Definition: ParaVertexBufferPool.cpp:241
uint32 m_nFullSizedBufferSize
we will reuse full sized buffer
Definition: ParaVertexBufferPool.h:68
AssetManager manages a set of asset entities of a certain type.
Definition: AssetManager.h:13
size_t m_nTotalBufferBytes
total number of bytes in memory.
Definition: ParaVertexBufferPool.h:74
void ReleaseBuffer(ParaVertexBuffer *pBuffer)
release the buffer.
Definition: ParaVertexBufferPool.cpp:163
int GetTotalBufferCount() const
including active and unused buffer count.
Definition: ParaVertexBufferPool.cpp:59
a manger of sequences
Definition: ParaVertexBufferPool.h:80
virtual HRESULT RendererRecreated()
callback of listening the event that renderer was recreated on Android/WP8 all opengl related id has ...
Definition: ParaVertexBufferPool.cpp:88
std::string AssetKey
the unique key object for asset entity.
Definition: AssetEntity.h:13
uint32 m_nMaxPooledCount
max number of pooled objects.
Definition: ParaVertexBufferPool.h:71
ParaVertexBuffer * CreateBuffer(uint32 nBufferSize, DWORD dwFormat=0, DWORD dwUsage=0, D3DPOOL dwPool=D3DPOOL_MANAGED)
recreate the buffer based on the new size.
Definition: ParaVertexBufferPool.cpp:130
Base class for managed asset entity in ParaEngine.
Definition: AssetEntity.h:25