Tidying up.

This commit is contained in:
David Williams 2014-05-24 08:38:18 +02:00
parent 6cbb2d44bf
commit f65edddd81
3 changed files with 14 additions and 5 deletions

View File

@ -77,7 +77,7 @@ public:
//The GL_ARRAY_BUFFER will contain the list of vertex positions
glGenBuffers(1, &(meshData.vertexBuffer));
glBindBuffer(GL_ARRAY_BUFFER, meshData.vertexBuffer);
glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(CubicVertex<uint8_t>), vecVertices.data(), GL_STATIC_DRAW);
glBufferData(GL_ARRAY_BUFFER, vecVertices.size() * sizeof(MeshType::VertexType), vecVertices.data(), GL_STATIC_DRAW);
//and GL_ELEMENT_ARRAY_BUFFER will contain the indices
glGenBuffers(1, &(meshData.indexBuffer));
@ -86,7 +86,7 @@ public:
//We need to tell OpenGL how to understand the format of the vertex data
glEnableVertexAttribArray(0); //We're talking about shader attribute '0'
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(CubicVertex<uint8_t>), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type)
glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(MeshType::VertexType), 0); //take the first 3 floats from every sizeof(decltype(vecVertices)::value_type)
glBindVertexArray(0);

View File

@ -45,10 +45,13 @@ namespace PolyVox
int endIndex; //Let's put it just past the end STL style
};
template <typename VertexType>
template <typename _VertexType>
class Mesh
{
public:
typedef _VertexType VertexType;
Mesh();
~Mesh();

View File

@ -36,11 +36,14 @@ namespace PolyVox
#ifdef SWIG
class CubicVertex
#else
template<typename VoxelType>
template<typename _VoxelType>
class POLYVOX_API CubicVertex
#endif
{
public:
typedef _VoxelType VoxelType;
CubicVertex()
{
}
@ -97,11 +100,14 @@ namespace PolyVox
#ifdef SWIG
class MarchingCubesVertex
#else
template<typename VoxelType>
template<typename _VoxelType>
class POLYVOX_API MarchingCubesVertex
#endif
{
public:
typedef _VoxelType VoxelType;
MarchingCubesVertex()
{
}