glBufferData usage

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

glBufferData usage

Joost Oudejans
I would like to use the method glBufferData(int target, long size, Buffer data, int usage) of GL, but I do not know how to calculate the size required.

I think the size can be calculated with the GLBuffers class. Could someone help me?
Reply | Threaded
Open this post in threaded view
|

Re: glBufferData usage

gouessej
Administrator
Hi

Rather use the class com.jogamp.common.nio.Buffers. Generally, I just do:
size = data.limit() * Buffers.SIZEOF_FLOAT; //for FloatBuffer instances
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: glBufferData usage

Joost Oudejans
Thank you, this will really help me.
Reply | Threaded
Open this post in threaded view
|

Re: glBufferData usage

gouessej
Administrator
You're welcome. I advise you to look at the documentation of the original C method when you have a doubt:
http://www.opengl.org/sdk/docs/man/xhtml/glBufferData.xml
Julien Gouesse | Personal blog | Website