- class TKar_MeshBuffer
- {
- protected:
- void* m_Data;
- unsigned int m_uiCount;
- unsigned int m_uiElementSize;
- bool m_bExternalList;
- public:
- TKar_MeshBuffer(unsigned int ElementSize);
- virtual ~TKar_MeshBuffer();
- virtual void Generate()=0;
- virtual void Delete()=0;//cleanup the internal reserved memory(e.g. glDestroyBuffer)
- virtual void Bind()=0;
- virtual void Unbind()=0;
- virtual void Clean();//cleanup m_Data to save memory
- virtual void Add(const void* AElement);
- virtual void UseList(const void* AList,const unsigned int ElementCount);
- virtual void* Get(const unsigned int Index);
- virtual unsigned int GetCount();
- };
- class TKar_VertexBufferOGL2:public TKar_MeshBuffer
- {
- ...
- };
- class TKar_IndexBufferOGL2:public TKar_VertexBufferOGL2
- {
- ...
- };
- class TKar_VertexBufferOGL3:public TKar_VertexBufferOGL2{};
- class TKar_IndexBufferOGL3:public TKar_IndexBufferOGL2{};
- class TKar_PhysicBuffer:public TKar_MeshBuffer
- {
- ...
- };
- class TKar_GraphicMaterial
- {
- ...
- };
- class TKar_PhysicalMaterial
- {
- ...
- };
- class TKar_GraphicModel
- {
- protected:
- map<string,TKar_MeshBuffer*> m_BufferMap;
- map<string,TKar_GraphicMaterial*> m_MaterialMap;
- public:
- virtual ~TKar_GraphicModel();
- virtual void RegisterBuffer(string Name, const TKar_MeshBuffer* Buffer)=0;
- virtual void RegisterMaterial(string Name, const TKar_GraphicMaterial* Material)=0;
- virtual void Draw(string Name);
- };
- class TKar_PhysicModel
- {
- protected:
- map<string,TKar_MeshBuffer*> m_BufferMap;
- map<string,TKar_PhysicalMaterial*> m_MaterialMap;
- public:
- virtual ~TKar_GraphicModel();
- virtual void RegisterBuffer(string Name, const TKar_MeshBuffer* Buffer)=0;
- virtual void RegisterMaterial(string Name, const TKar_PhysicalMaterial* Material)=0;
- virtual void Update(string Name);
- };
- class TKar_ModelAdapter
- {
- protected:
- TKar_PhysicModel* m_PhysicModel;
- TKar_GraphicModel* m_GraphicModel;
- public:
- TKar_PhysicModel* GetPhysicModelData();
- TKar_GraphicModel* GetGraphicModelData();
- void Load(string Filename);
- };
- class TKar_KarmaramaModelAdapter:public TKar_ModelAdapter
- {
- ...
- };
- class TKar_ModelNode:public TKar_Node
- {
- protected:
- TKar_PhysicModel* m_PhysicModel;
- TKar_GraphicModel* m_GraphicModel;
- string m_sModelname;
- public:
- void Update();
- void Draw(TKar_RenderPass Pass);
- void LoadData();
- };