Posts: 11
Joined: Wed Aug 15, 2018 9:15 pm
Location: India

boost::circular_buffer and openGL glBufferData not getting along.

Fri Dec 21, 2018 11:08 pm


I'm storing some vertex data in:

boost::circular_buffer<int> bufferData(200);

My class has a function to return a pointer to the address of bufferData.front():

int *getBufferData() {return &bufferData.front();}

Then i send this pointer to glBufferData:

glBufferData(GL_ARRAY_BUFFER, 200*sizeof(int), MyClass.getBufferData(), GL_STATIC_DRAW);

The screen renders, however i don't get the right coordinates to show almost looks as if openGL is plotting the addresses instead of the actual data in my circular buffer.

Can anyone confirm if this is the right way to send the data?

Return to “Graphics programming”