com.io7m.jcanephora.async

## Class JCGLAsyncInterfaceGL33

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

- All Implemented Interfaces:
    JCGLAsyncInterfaceGL33Type, JCGLAsyncInterfaceUsableGL33Type, 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
    --- | ---
    `<A,B> CompletableFuture<B>` | `evaluateWith(A c, BiFunction<JCGLInterfaceGL33Type,A,B> f)` 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`

    - ### Methods inherited from interface com.io7m.jcanephora.async.JCGLAsyncInterfaceUsableGL33Type

      `evaluate`

- - ### 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

    - #### 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.

    - #### evaluateWith

          public <A,B> CompletableFuture<B> evaluateWith(A c,
                                                         BiFunction<JCGLInterfaceGL33Type,A,B> f)

      Description copied from interface: `JCGLAsyncInterfaceUsableGL33Type`
      Evaluate a function on the context's dedicated OpenGL thread.
      Specified by:
        `evaluateWith` in interface `JCGLAsyncInterfaceUsableGL33Type`
      Type Parameters:
        `A` - The type of user-defined context values
        `B` - The type of returned values
      Parameters:
        `c` - A user-defined context value, passed to `f`
        `f` - The function that will be evaluated
      Returns:
        The value returned by `f`

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