I am creating an array of positions to draw and I am stuck when I am using dma for the array
if I declare the size of the array and populate I can get it to work but if I do
float *datac;
datac=NULL;
datac = new float[12];
datac[0] = 0;datac[1] = 0;datac[2] = 0;
datac[3] = 0;datac[4] = 100;datac[5] = 0;
datac[6] = 100;datac[7] = 100;datac[8] = 0;
datac[9] = 100;datac[10] = 0;datac[11] = 0;
//how do I pass it through to these functions
//this is what I was using when I done float datac[12] = ....
//I have tried using this sizeof(*datac)*sizeof(float)
//which compiles but just does not draw
glBufferData(GL_ARRAY_BUFFER, sizeof(datac), datac, GL_STATIC_DRAW);
glDrawArrays(GL_QUADS, 0, sizeof(datac)/ sizeof(float) / 3);
Being dull and I cant think what I need to do
It’s C++, so you can use
std::vectorand make your life easy: