Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

reading from buffer/s - OpenGL

Tags:

buffer

opengl

I am using glGenBuffers,which creates a handle/s that is used to refer to the buffer when talking to gl.Can I use the handle to read the content of the buffer/s? If yes - how?

like image 501
Yakov Avatar asked Feb 16 '12 15:02

Yakov


1 Answers

There are two ways to read data from a Buffer Object. There is glGetBufferSubData, which directly copies buffer data into a pointer of your choice.

You can also map the buffer for reading. That requires using glMapBufferRange (or glMapBuffer if you're old-school), which you can use to get a pointer to the buffer objects data and read directly.

like image 84
Nicol Bolas Avatar answered Oct 05 '22 09:10

Nicol Bolas