5 #include "IAsyncTexture.h"
11 namespace AsyncTexturing
13 template<
typename TRefCounted>
17 int GetReferenceCount()
const
19 Eegeo_ASSERT(m_referenceCount >= 0,
"invalid ref count -- mismatched Increment/Decrement")
20 return m_referenceCount;
23 void IncrementReferenceCount()
26 Eegeo_ASSERT(m_referenceCount > 0,
"invalid ref count -- mismatched Increment/Decrement");
29 void DecrementReferenceCount()
31 Eegeo_ASSERT(m_referenceCount > 0,
"invalid ref count -- mismatched Increment/Decrement");
34 if (m_referenceCount == 0)
36 Self().DestroyTexture();
41 bool IsReferenced()
const
43 Eegeo_ASSERT(m_referenceCount >= 0,
"invalid ref count -- mismatched Increment/Decrement");
44 return m_referenceCount > 0;
51 TRefCounted& Self() {
return *(Eegeo::CheckedCast<TRefCounted*>(
this)); }