com.io7m.jcanephora.async

## Class JCGLAsyncInterfaceGL33

- java.lang.Object
- - com.io7m.jcanephora.async.JCGLAsyncInterfaceGL33

- All Implemented Interfaces:
    JCGLAsyncInterfaceGL33Type, JCGLResourceUsableType

      public final class JCGLAsyncInterfaceGL33
      extends Object
      implements JCGLAsyncInterfaceGL33Type

  The default implementation of the `JCGLAsyncInterfaceGL33Type` interface.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T> CompletableFuture<T>` | `evaluate(Function<JCGLInterfaceGL33Type,T> c)` Evaluate a function on the context's dedicated OpenGL thread.
    `boolean` | `isDeleted()`
    `static JCGLAsyncInterfaceGL33Type` | `newAsync(Supplier<JCGLContextType> c)` Construct an async interface, evaluating the given function to obtain a context that will be used exclusively for async calls.
    `CompletableFuture<Void>` | `shutDown()` Schedule an orderly shutdown of the interface.

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

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

- - ### Method Detail

    - #### newAsync

          public static JCGLAsyncInterfaceGL33Type newAsync(Supplier<JCGLContextType> c)

      Construct an async interface, evaluating the given function to obtain a context that will be used exclusively for async calls. A new dedicated thread will be created for GL calls, and the context returned from `c` will be made current on that thread.
      Parameters:
        `c` - The context supplier
      Returns:
        A new async interface

    - #### evaluate

          public <T> CompletableFuture<T> evaluate(Function<JCGLInterfaceGL33Type,T> c)

      Description copied from interface: `JCGLAsyncInterfaceGL33Type`
      Evaluate a function on the context's dedicated OpenGL thread.
      Specified by:
        `evaluate` in interface `JCGLAsyncInterfaceGL33Type`
      Type Parameters:
        `T` - The type of returned values
      Parameters:
        `c` - The function that will be evaluated
      Returns:
        The value returned by `c`

    - #### shutDown

          public CompletableFuture<Void> shutDown()
                                           throws JCGLException

      Description copied from interface: `JCGLAsyncInterfaceGL33Type`
      Schedule an orderly shutdown of the interface. This releases the underlying OpenGL context but does not destroy it.
      Specified by:
        `shutDown` in interface `JCGLAsyncInterfaceGL33Type`
      Returns:
        A future representing the shutdown in progress
      Throws:
        `JCGLException`

    - #### isDeleted

          public boolean isDeleted()

      Specified by:
        `isDeleted` in interface `JCGLResourceUsableType`
      Returns:
        `true` iff the given resource has been deleted.

Copyright © 2016 <code@io7m.com> http://io7m.com