Class GLContext.Builder<B extends GLContext.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
GLContext

public static class GLContext.Builder<B extends GLContext.Builder<B>> extends DrawContext.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public GLContext build()
      Finish building the GLContext object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to GLContext.
      Overrides:
      build in class DrawContext.Builder<B extends GLContext.Builder<B>>
      Returns:
      a new instance of GLContext with the properties that were set in the Builder object.
    • setAllowedApis

      public B setAllowedApis(Set<GLAPI> allowedApis)
      The allowed APIs.
      Parameters:
      allowedApis - the value for the allowed-apis property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.6
    • setSharedContext

      @Deprecated public B setSharedContext(GLContext sharedContext)
      Deprecated.
      Use GLContext.isShared(GLContext) to check if contexts can be shared.

      Always null

      As many contexts can share data now and no single shared context exists anymore, this function has been deprecated and now always returns null.

      Parameters:
      sharedContext - the value for the shared-context property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setAllowedApis

      public B setAllowedApis(GLAPI... allowedApis)
      The allowed APIs.
      Parameters:
      allowedApis - the value for the allowed-apis property
      Returns:
      the Builder instance is returned, to allow method chaining
      Since:
      4.6