Package icyllis.arc3d.opengl

# Class GLBuffer

java.lang.Object
icyllis.arc3d.engine.Resource
icyllis.arc3d.engine.Buffer
icyllis.arc3d.opengl.GLBuffer

All Implemented Interfaces:
  `RefCounted`

public final class GLBuffer extends Buffer

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from class icyllis.arc3d.engine.Buffer

  `Buffer.ResourceKey`

- ## Field Summary

  ### Fields inherited from class icyllis.arc3d.engine.Buffer

  `kRead_MapMode, kWriteDiscard_MapMode, mSize, mUsage`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static void`
  `doUploadData(GLDevice device, int buffer, int target, long data, long offset, long totalSize)`
  `int`
  `getBindingTarget()`
  `static int`
  `getBufferStorageFlags(int usage)`
  `long`
  `getClientUploadBuffer()`
  `protected GLDevice`
  `getDevice()`
  `int`
  `getHandle()`
  `static int`
  `getMutableBufferUsage(int usage)`
  `int`
  `getTarget()`
  Returns a default target for this buffer.
  `static @SharedPtr GLBuffer`
  `make(Context context, long size, int usage)`
  `protected long`
  `onMap(int mode, long offset, long size)`
  `protected void`
  `onRelease()`
  Subclass should override this method to free GPU resources in the backend API.
  `protected void`
  `onSetLabel(String label)`
  Subclass should override this method to set object label in the backend API.
  `protected void`
  `onUnmap(int mode, long offset, long size)`

  ### Methods inherited from class icyllis.arc3d.engine.Buffer

  `getMappedBuffer, getSize, getUsage, isMapped, map, map, unmap, unmap, updateData`

  ### Methods inherited from class icyllis.arc3d.engine.Resource

  `getContext, getKey, getLabel, getMemorySize, getUniqueID, hasAnyRefs, hasCacheRef, hasCommandBufferRef, hasUsageRef, isBudgeted, isDestroyed, isPurgeable, isWrapped, ref, refCommandBuffer, setKey, setLabel, setNonCacheable, unref, unrefCommandBuffer`

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

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### make

    @Nullable @SharedPtr public static @SharedPtr GLBuffer make(Context context, long size, int usage)

  - ### getBufferStorageFlags

    public static int getBufferStorageFlags(int usage)

  - ### getMutableBufferUsage

    public static int getMutableBufferUsage(int usage)

  - ### getHandle

    public int getHandle()

  - ### getClientUploadBuffer

    public long getClientUploadBuffer()

  - ### getTarget

    public int getTarget()
    Returns a default target for this buffer.

  - ### getBindingTarget

    public int getBindingTarget()

  - ### onSetLabel

    protected void onSetLabel(@Nullable String label)
    Description copied from class: `Resource`
    Subclass should override this method to set object label in the backend API.
    Overrides:
      `onSetLabel` in class `Resource`

  - ### onRelease

    protected void onRelease()
    Description copied from class: `Resource`
    Subclass should override this method to free GPU resources in the backend API.
    Specified by:
      `onRelease` in class `Resource`

  - ### getDevice

    protected GLDevice getDevice()
    Overrides:
      `getDevice` in class `Resource`
    Returns:
      the device or null if destroyed

  - ### onMap

    protected long onMap(int mode, long offset, long size)
    Specified by:
      `onMap` in class `Buffer`

  - ### onUnmap

    protected void onUnmap(int mode, long offset, long size)
    Specified by:
      `onUnmap` in class `Buffer`

  - ### doUploadData

    public static void doUploadData(GLDevice device, int buffer, int target, long data, long offset, long totalSize)