I noticed on all the tutorials you create the vertexbuffer the number of vetices times the size of the class why is this so why woudent you create the VertexBuffer just the size of the class holding your points to draw?
so i made a program to understand why you would need all this extra memory but i still cant firgure it out.
Code:
#include <iostream>
using namespace std;
class VertexBuffer
{
public:
float x,y,z;
};
int main()
{
VertexBuffer VBuffer[5] =
{
{1,2,1},
{2,2,2},
{0,1,0},
{3,1,3},
{9,5,1},
};
cout << "buffer size : " << sizeof(VBuffer) <<endl;
cout << "Seven times Buffer size : " << sizeof(VBuffer)*5 <<endl;
cin.get();
}
Please explain this to me is there something im not seeing or is this just a waste of memory.