Class OESMapbuffer


  • public final class OESMapbuffer
    extends Object
    • Field Detail

      • GL_WRITE_ONLY_OES

        public static final int GL_WRITE_ONLY_OES
        Accepted by the <access> parameter of MapBufferOES:
        See Also:
        Constant Field Values
      • GL_BUFFER_ACCESS_OES

        public static final int GL_BUFFER_ACCESS_OES
        Accepted by the <value> parameter of GetBufferParameteriv:
        See Also:
        Constant Field Values
      • GL_BUFFER_MAPPED_OES

        public static final int GL_BUFFER_MAPPED_OES
        Accepted by the <value> parameter of GetBufferParameteriv:
        See Also:
        Constant Field Values
      • GL_BUFFER_MAP_POINTER_OES

        public static final int GL_BUFFER_MAP_POINTER_OES
        Accepted by the <pname> parameter of GetBufferPointervOES:
        See Also:
        Constant Field Values
    • Method Detail

      • glGetBufferPointerOES

        public static ByteBuffer glGetBufferPointerOES​(int target,
                                                       int pname,
                                                       ByteBuffer old_buffer)
      • glGetBufferPointervOES

        public static ByteBuffer glGetBufferPointervOES​(int target,
                                                        int pname,
                                                        long length,
                                                        ByteBuffer old_buffer)
      • glMapBufferOES

        public static ByteBuffer glMapBufferOES​(int target,
                                                int access,
                                                ByteBuffer old_buffer)
        glMapBufferOES maps a GL buffer object to a ByteBuffer. The old_buffer argument can be null, in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null, it will be returned if it points to the same mapped memory and has the same capacity as the buffer object, otherwise a new ByteBuffer is created. That way, an application will normally use glMapBuffer like this:

        ByteBuffer mapped_buffer; mapped_buffer = glMapBufferOES(..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBufferOES(..., ..., mapped_buffer);

        Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.

        The version of this method without an explicit length argument calls glGetBufferParameter internally to retrieve the current buffer object size, which may cause a pipeline flush and reduce application performance.

        The version of this method with an explicit length argument is a fast alternative to the one without. No GL call is made to retrieve the buffer object size, so the user is responsible for tracking and using the appropriate length.
        Security warning: The length argument should match the buffer object size. Reading from or writing to outside the memory region that corresponds to the mapped buffer object will cause native crashes.

        Parameters:
        old_buffer - A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.

        Returns:
        A ByteBuffer representing the mapped buffer memory.
      • glMapBufferOES

        public static ByteBuffer glMapBufferOES​(int target,
                                                int access,
                                                long length,
                                                ByteBuffer old_buffer)
        glMapBufferOES maps a GL buffer object to a ByteBuffer. The old_buffer argument can be null, in which case a new ByteBuffer will be created, pointing to the returned memory. If old_buffer is non-null, it will be returned if it points to the same mapped memory and has the same capacity as the buffer object, otherwise a new ByteBuffer is created. That way, an application will normally use glMapBuffer like this:

        ByteBuffer mapped_buffer; mapped_buffer = glMapBufferOES(..., ..., null); ... // Another map on the same buffer mapped_buffer = glMapBufferOES(..., ..., mapped_buffer);

        Only ByteBuffers returned from this method are to be passed as the old_buffer argument. User-created ByteBuffers cannot be reused.

        The version of this method without an explicit length argument calls glGetBufferParameter internally to retrieve the current buffer object size, which may cause a pipeline flush and reduce application performance.

        The version of this method with an explicit length argument is a fast alternative to the one without. No GL call is made to retrieve the buffer object size, so the user is responsible for tracking and using the appropriate length.
        Security warning: The length argument should match the buffer object size. Reading from or writing to outside the memory region that corresponds to the mapped buffer object will cause native crashes.

        Parameters:
        old_buffer - A ByteBuffer. If this argument points to the same address and has the same capacity as the new mapping, it will be returned and no new buffer will be created.

        Returns:
        A ByteBuffer representing the mapped buffer memory.
      • glUnmapBufferOES

        public static boolean glUnmapBufferOES​(int target)