Login  Register

Re: Another variant for glBufferData?

Posted by Sven Gothel on Aug 22, 2014; 6:51am
URL: https://forum.jogamp.org/Another-variant-for-glBufferData-tp4032875p4032886.html

On 08/22/2014 01:30 AM, gouessej [via jogamp] wrote:
> Hi
>
> It would be a bad idea as anyway a direct NIO buffer would have to be created
> under the hood in order to communicate with native OpenGL.

+++

Our API doc says:

  /** Entry point to C language function: <code> void {@native
glBufferData}(GLenum target, GLsizeiptr size, const GLvoid *  data, GLenum
usage) </code> <br>Part of <code>GL_VERSION_1_5</code>,
<code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_ES_CL_CM</code>
      @param data a direct or array-backed {@link java.nio.Buffer}

++

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).

In short, if you prefer, use an array backed FloatBuffer (non NIO),
however - AFAIK our unit tests have not covered this variation.

~Sven



signature.asc (828 bytes) Download Attachment