Login  Register

Re: Another variant for glBufferData?

Posted by jmaasing on Aug 22, 2014; 11:37am
URL: https://forum.jogamp.org/Another-variant-for-glBufferData-tp4032875p4032893.html

Sven Gothel wrote
The manual page does not make it specific whether the client storage
must exist past function call:
  https://www.opengl.org/sdk/docs/man/html/glBufferData.xhtml

Hence it would be legal w/ an array-backed client storage,
even though your mileage may vary on certain OpenGL drivers .. (bugs).
Yes, this was confusing to me also in the beginning. I started out generating meshes into heap memory for processing but then it was unclear to me the best way to pass data into the GL-methods.
Maybe there is some way to include in the javadoc a pointer to a "best practice" description, e.g. "You can use the helper classes in com.jogamp.common.nio.Buffers to create a suitable buffer" in those cases where it makes sense.