Vertex Buffer Object Manager

It has been a long time that no update shows up here. Sorry....
I have been working on the requirement on a new Demo Engine, which is small and flexible.
After doing some survey all these days, I found that it is very necessary to support both GL and D3D to my engine.

For GL, it is state machine based so that an encapsulation for VBO is very vital for the rendering pipe line.

Here are the diagrams to show the class relationships:

Buffer diagram

Both vertex buffer and index buffer are inheritant from the buffer object class.
They provide  both reading and writing to the buffer object, bind/unbind, size calculation, etc.

VertexElement and VertexDeclaration are util class that helps to utilize the format of the rendering vertices. The user(programmer) can declare attribute of vertex, like position, normal, diffuse color, specular color, tangent, etc.

 



All the operation including creation, modification and deletion of buffer objects are calling from the BufferManager, which is a singelton class.

Here is the source code: VBO Manager

posted on 2008-02-27 18:32  SigEric  阅读(507)  评论(0编辑  收藏  举报

导航