Package icyllis.arc3d.opengl

# Class GLBackendImage

java.lang.Object
icyllis.arc3d.engine.BackendImage
icyllis.arc3d.opengl.GLBackendImage

public final class GLBackendImage extends BackendImage
When importing external memory, `memoryHandle` is POSIX file descriptor or Win32 NT handle. `memoryObject` is OpenGL memory object. If it is an NT handle, it must be released manually by the memory exporter (e.g. Vulkan).

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `int`
  `handle`
  `GLuint` - image name
  `int`
  `levels`
  `GLsizei` - number of mip levels
  `long`
  `memoryHandle`
  `union { int fd; // file descriptor HANDLE handle; // win32 handle };`
  `int`
  `memoryObject`
  `GLuint` - memory

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

  `mDesc, mMutableState`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `GLBackendImage(int width, int height, GLImageDesc desc)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `getBackend()`
  `BackendFormat`
  `getBackendFormat()`
  Get the BackendFormat for this image/texture.
  `GLImageDesc`
  `getGLImageInfo()`
  `void`
  `glTextureParametersModified()`
  Call this to indicate that the texture parameters have been modified in the GL context externally to Context.
  `boolean`
  `isExternal()`
  `boolean`
  `isProtected()`
  Returns true if we are working with protected content.
  `boolean`
  `isSameImage(BackendImage image)`
  Returns true if both images are valid and refer to the same API image handle.
  `String`
  `toString()`

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

  `getArraySize, getDepth, getDesc, getHeight, getImageType, getMipLevelCount, getMutableState, getWidth, isMipmapped, setVkImageLayout, setVkQueueFamilyIndex`

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

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

- ## Field Details

  - ### handle

    public int handle
    `GLuint` - image name

  - ### levels

    public int levels
    `GLsizei` - number of mip levels

  - ### memoryObject

    public int memoryObject
    `GLuint` - memory

  - ### memoryHandle

    public long memoryHandle

         union {
             int fd; // file descriptor
             HANDLE handle; // win32 handle
         };

- ## Constructor Details

  - ### GLBackendImage

    public GLBackendImage(int width, int height, GLImageDesc desc)

- ## Method Details

  - ### getBackend

    public int getBackend()
    Specified by:
      `getBackend` in class `BackendImage`
    Returns:
      see `Engine.BackendApi`

  - ### isExternal

    public boolean isExternal()
    Specified by:
      `isExternal` in class `BackendImage`
    Returns:
      external texture

  - ### getGLImageInfo

    public GLImageDesc getGLImageInfo()

  - ### glTextureParametersModified

    public void glTextureParametersModified()
    Description copied from class: `BackendImage`
    Call this to indicate that the texture parameters have been modified in the GL context externally to Context.

    Tells client that these parameters of the texture are changed out of client control (for example, you called glTexParameteri without using `GLDevice`). The local states will be forced to reset to a known state when next use.

    Overrides:
      `glTextureParametersModified` in class `BackendImage`

  - ### getBackendFormat

    @Nonnull public BackendFormat getBackendFormat()
    Description copied from class: `BackendImage`
    Get the BackendFormat for this image/texture.
    Specified by:
      `getBackendFormat` in class `BackendImage`

  - ### isProtected

    public boolean isProtected()
    Description copied from class: `BackendImage`
    Returns true if we are working with protected content.
    Specified by:
      `isProtected` in class `BackendImage`

  - ### isSameImage

    public boolean isSameImage(BackendImage image)
    Description copied from class: `BackendImage`
    Returns true if both images are valid and refer to the same API image handle.
    Specified by:
      `isSameImage` in class `BackendImage`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`