Class OALHandle

java.lang.Object
com.blackrook.gloop.openal.OALHandle
Direct Known Subclasses:
OALContext, OALDevice

public abstract class OALHandle extends Object
Generic OpenAL handle type. Essentially an object that is not an integer id - this wraps a memory address.
Author:
Matthew Tropiano
  • Constructor Details

    • OALHandle

      protected OALHandle()
      Allocates a new OpenAL handle.
  • Method Details

    • getHandle

      public abstract long getHandle()
      Returns:
      this handle's OpenAL address handle.
    • isCreated

      public abstract boolean isCreated()
      Returns:
      true if this handle was allocated, false if not.
    • destroy

      public abstract void destroy()
      Destroys this handle. Does nothing if already destroyed.
      Throws:
      SoundException - if a problem occurs during free.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(OALHandle handle)
      Tests if this OpenAL handle equals the provided one.
      Parameters:
      handle - the handle to test.
      Returns:
      true if so, false if not.
    • finalize

      public void finalize() throws Throwable
      Frees this object from OpenAL. Safe, since OpenAL is thread-safe. AS ALWAYS, NEVER CALL DIRECTLY.
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • toString

      public String toString()
      Overrides:
      toString in class Object