- working VBO code for static objects in game, currently disabled in code but to enabled edit model.h and uncomment #define ENABLE_VBO_CODE

This commit is contained in:
Mark Vejvoda
2011-01-18 23:56:30 +00:00
parent 7c15f58286
commit 6b0bc35e3c
8 changed files with 195 additions and 65 deletions

View File

@@ -76,8 +76,11 @@ private:
#if defined(ENABLE_VBO_CODE)
// Vertex Buffer Object Names
uint32 m_nVBOVertices; // Vertex VBO Name
uint32 m_nVBOTexCoords; // Texture Coordinate VBO Name
bool hasBuiltVBOs;
uint32 m_nVBOVertices; // Vertex VBO Name
uint32 m_nVBOTexCoords; // Texture Coordinate VBO Name
uint32 m_nVBONormals; // Normal VBO Name
uint32 m_nVBOIndexes; // Indexes VBO Name
#endif
public:
@@ -97,9 +100,15 @@ public:
uint32 getTriangleCount() const;
#if defined(ENABLE_VBO_CODE)
uint32 getVBOVertices() const { return m_nVBOVertices;}
uint32 getVBOVertices() const { return m_nVBOVertices;}
uint32 getVBOTexCoords() const { return m_nVBOTexCoords;}
uint32 getVBONormals() const { return m_nVBONormals;}
uint32 getVBOIndexes() const { return m_nVBOIndexes;}
bool hasBuiltVBOEntities() const { return hasBuiltVBOs;}
void BuildVBOs();
void ReleaseVBOs();
#endif
//data
@@ -159,6 +168,7 @@ private:
float lastTVertex;
bool lastCycleVertex;
string fileName;
bool isStaticModel;
public:
@@ -177,6 +187,7 @@ public:
uint8 getFileVersion() const {return fileVersion;}
uint32 getMeshCount() const {return meshCount;}
const Mesh *getMesh(int i) const {return &meshes[i];}
Mesh *getMeshPtr(int i) const {return &meshes[i];}
uint32 getTriangleCount() const;
uint32 getVertexCount() const;
@@ -193,6 +204,8 @@ public:
bool getIsStaticModel() const { return isStaticModel; }
void setIsStaticModel(bool value) { isStaticModel = value; }
string getFileName() const { return fileName; }
private:
void buildInterpolationData() const;
};