Exemplo n.º 1
0
 /** DoubleBuffer version of: {@link #glBufferData BufferData} */
 public static void glBufferData(int target, DoubleBuffer data, int usage) {
   nglBufferData(target, data.remaining() << 3, memAddress(data), usage);
 }
Exemplo n.º 2
0
 /**
  * <a href="http://www.opengl.org/sdk/docs/man/html/glBufferData.xhtml">OpenGL SDK Reference</a>
  * Creates and initializes a buffer object's data store.
  *
  * <p>{@code usage} is a hint to the GL implementation as to how a buffer object's data store will
  * be accessed. This enables the GL implementation to make more intelligent decisions that may
  * significantly impact buffer object performance. It does not, however, constrain the actual
  * usage of the data store. {@code usage} can be broken down into two parts: first, the frequency
  * of access (modification and usage), and second, the nature of that access. The frequency of
  * access may be one of these:
  *
  * <ul>
  *   <li><em>STREAM</em> - The data store contents will be modified once and used at most a few
  *       times.
  *   <li><em>STATIC</em> - The data store contents will be modified once and used many times.
  *   <li><em>DYNAMIC</em> - The data store contents will be modified repeatedly and used many
  *       times.
  * </ul>
  *
  * The nature of access may be one of these:
  *
  * <ul>
  *   <li><em>DRAW</em> - The data store contents are modified by the application, and used as the
  *       source for GL drawing and image specification commands.
  *   <li><em>READ</em> - The data store contents are modified by reading data from the GL, and
  *       used to return that data when queried by the application.
  *   <li><em>COPY</em> - The data store contents are modified by reading data from the GL, and
  *       used as the source for GL drawing and image specification commands.
  * </ul>
  *
  * @param target the target buffer object. One of:<br>
  *     {@link #GL_ARRAY_BUFFER ARRAY_BUFFER}, {@link #GL_ELEMENT_ARRAY_BUFFER
  *     ELEMENT_ARRAY_BUFFER}, {@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}, {@link
  *     GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}, {@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER
  *     TRANSFORM_FEEDBACK_BUFFER}, {@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}, {@link
  *     GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}, {@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER},
  *     {@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}, {@link GL40#GL_DRAW_INDIRECT_BUFFER
  *     DRAW_INDIRECT_BUFFER}, {@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}, {@link
  *     GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}, {@link
  *     GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}, {@link
  *     ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
  * @param size the size in bytes of the buffer object's new data store
  * @param data a pointer to data that will be copied into the data store for initialization, or
  *     NULL if no data is to be copied
  * @param usage the expected usage pattern of the data store. One of:<br>
  *     {@link #GL_STREAM_DRAW STREAM_DRAW}, {@link #GL_STREAM_READ STREAM_READ}, {@link
  *     #GL_STREAM_COPY STREAM_COPY}, {@link #GL_STATIC_DRAW STATIC_DRAW}, {@link #GL_STATIC_READ
  *     STATIC_READ}, {@link #GL_STATIC_COPY STATIC_COPY}, {@link #GL_DYNAMIC_DRAW DYNAMIC_DRAW},
  *     {@link #GL_DYNAMIC_READ DYNAMIC_READ}, {@link #GL_DYNAMIC_COPY DYNAMIC_COPY}
  */
 public static void glBufferData(int target, long size, ByteBuffer data, int usage) {
   if (LWJGLUtil.CHECKS) if (data != null) checkBuffer(data, size);
   nglBufferData(target, size, memAddressSafe(data), usage);
 }
Exemplo n.º 3
0
 /** Alternative version of: {@link #glBufferData BufferData} */
 public static void glBufferData(int target, long size, int usage) {
   nglBufferData(target, size, 0L, usage);
 }
Exemplo n.º 4
0
 /** Unsafe version of {@link #glBufferData BufferData} */
 @JavadocExclude
 public static void nglBufferData(int target, long size, long data, int usage) {
   long __functionAddress = getInstance().BufferData;
   nglBufferData(target, size, data, usage, __functionAddress);
 }