javax.media.opengl

## Class GLBufferStorage

- java.lang.Object
- - javax.media.opengl.GLBufferStorage

-     public abstract class GLBufferStorage
      extends Object

  OpenGL buffer storage object reflecting it's
  - storage size
  - storage memory if mapped
  - mutable usage or immutable flags

  Buffer storage is created via:

  - `glBufferStorage` - storage creation with target
  - `GL.glBufferData(int, long, java.nio.Buffer, int)` - storage recreation with target
  - `GL2.glNamedBufferDataEXT(int, long, java.nio.Buffer, int)` - storage recreation, direct
  Note that storage recreation as mentioned above also invalidate a previous storage instance, i.e. disposed the buffer's current storage if exist and attaches a new storage instance.

  Buffer storage is disposed via:

  - `GL.glDeleteBuffers(int, IntBuffer)` - explicit, direct, via `#notifyBuffersDeleted(int, IntBuffer)` or `#notifyBuffersDeleted(int, int[], int)`
  - `GL.glBufferData(int, long, java.nio.Buffer, int)` - storage recreation via target
  - `GL2.glNamedBufferDataEXT(int, long, java.nio.Buffer, int)` - storage recreation, direct

  GL buffer storage is mapped via

  - `GLBase.mapBuffer(int, int)`
  - `GLBase.mapBufferRange(int, long, long, int)`
  - `GL2.mapNamedBuffer(int, int)`
  - `GL2.mapNamedBufferRange(int, long, long, int)`

  GL buffer storage is unmapped via

  - `GL.glUnmapBuffer(int)` - explicit via target
  - `GL2.glUnmapNamedBufferEXT(int)` - explicit direct
  - `GL.glBufferData(int, long, java.nio.Buffer, int)` - storage recreation via target
  - `GL2.glNamedBufferDataEXT(int, long, java.nio.Buffer, int)` - storage recreation, direct
  - `GL.glDeleteBuffers(int, IntBuffer)` - buffer deletion

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getImmutableFlags()` Returns the immutable storage flags, invalid if storage is `mutable`.
    `ByteBuffer` | `getMappedBuffer()` Returns the mapped ByteBuffer, or null if not mapped.
    `int` | `getMutableUsage()` Returns the mutable storage usage or 0 if storage is not `mutable`.
    `int` | `getName()` Return the buffer name
    `long` | `getSize()` Return the buffer's storage size.
    `boolean` | `isMutableStorage()` Returns `true` if buffer's storage is mutable, i.e.
    `String` | `toString()`
    `String` | `toString(boolean skipMappedBuffer)`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### getName

          public final int getName()

      Return the buffer name

    - #### getSize

          public final long getSize()

      Return the buffer's storage size.

    - #### isMutableStorage

          public final boolean isMutableStorage()

      Returns `true` if buffer's storage is mutable, i.e. created via `GL.glBufferData(int, long, java.nio.Buffer, int)`.

      Returns `false` if buffer's storage is immutable, i.e. created via `glBufferStorage`. FIXME: Add GL 4.4 support!

      Returns:

    - #### getMutableUsage

          public final int getMutableUsage()

      Returns the mutable storage usage or 0 if storage is not `mutable`.

    - #### getImmutableFlags

          public final int getImmutableFlags()

      Returns the immutable storage flags, invalid if storage is `mutable`.

    - #### getMappedBuffer

          public final ByteBuffer getMappedBuffer()

      Returns the mapped ByteBuffer, or null if not mapped. Mapping may occur via:
      - `GL.glMapBuffer(int, int)`
      - `GL.glMapBufferRange(int, long, long, int)`
      - `GL2.glMapNamedBufferEXT(int, int)`
      - `GL2.glMapNamedBufferRangeEXT(int, long, long, int)`

    - #### toString

          public final String toString()

      Overrides:
        `toString` in class `Object`

    - #### toString

          public final String toString(boolean skipMappedBuffer)

Copyright 2010 JogAmp Community.