I am trying to write a module in python which will draw a numpy array of color data (rgb) to screen. At the moment I am currently using a 3 dimensional color array like this:
numpy.ones((10,10,3),dtype=np.float32,order='F') # (for 10x10 pure white tiles)
binding it to a buffer and using a glVertexAttribArray
to broadcast the data to an array of tiles (point sprites) (in this case a 10x10 array) and this works fine for a static image.
But I want to be able to change the data in the array and have buffer reflect this change without having to rebuild it from scratch.
Currently I've built the buffer with:
glBufferData(GL_ARRAY_BUFFER, buffer_data.nbytes, buffer_data, GL_DYNAMIC_DRAW)
where buffer_data is the numpy array. What (if anything) could I pass instead (some pointer into memory perhaps?)