Interface ILcdGLDrawableFactory


public interface ILcdGLDrawableFactory
Factory for creating ILcdGLDrawable instances. An ILcdGLDrawable provides an application with an OpenGL context that it can draw into. An implementation of ILcdGLDrawableFactory can be obtained from ALcdGLBinding.

This factory can create two types of drawables:

  • Visible drawables, embedded in an AWT component or JavaFX node. For AWT applications, a TLcdGLDrawableHolder encapsulates both the ILcdGLDrawable and the Component that can be shown on screen. JavaFX drawables can be cast directly to a JavaFX Node.
  • Offscreen drawables. An offscreen drawable is not displayable as such, but its contents can be retrieved as an Image.
ILcdGLDrawables can be created using a variety of parameters. Most importantly, a drawable can be created for a user-specified ILcdGLCapabilities. The capabilities object provides various hints about the layout of the framebuffer to be used by the drawable. These hints include the desired color depth, the presence of depth/stencil/accumulation buffers and more. Optionally, an ILcdGLCapabilitiesChooser can be specified to to determine how the drawable factory chooses an appropriate set of capabilities from those supported by the underlying graphics hardware.

An ILcdGLDrawable can also perform OpenGL context sharing with another drawable. This is done by passing the other drawable as an argument to the createGLDrawable() method. The two drawables will then be able to share certain OpenGL resources, such as texture objects and display lists.

Finally, ILcdGLDrawables can also be created for a specific GraphicsDevice. This is useful in multi-monitor configurations where the application wants to control on which display device the drawable is created.

See Also:
  • Method Details

    • createGLCapabilities

      ILcdGLCapabilities createGLCapabilities()
      Creates a new ILcdGLCapabilities object with default parameters. This object can be modified according to the application's requirements and then be used to create an ILcdGLDrawable.
      Returns:
      an ILcdGLCapabilities
    • createGLDrawable

      default TLcdGLDrawableHolder createGLDrawable()
      Creates a new ILcdGLDrawable with default capabilities.
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createGLDrawable

      default TLcdGLDrawableHolder createGLDrawable(ILcdGLCapabilities aGLCapabilities)
      Creates a new ILcdGLDrawable with the specified capabilities.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aGLCapabilities - an ILcdGLCapabilities
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createGLDrawable

      default TLcdGLDrawableHolder createGLDrawable(GraphicsDevice aGraphicsDevice)
      Creates an ILcdGLDrawable with default capabilities for the specified GraphicsDevice. This method can be used in multi-monitor environments to create a drawable for a specific display device.
      Parameters:
      aGraphicsDevice - a GraphicsDevice
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createGLDrawable

      default TLcdGLDrawableHolder createGLDrawable(ILcdGLCapabilities aGLCapabilities, GraphicsDevice aGraphicsDevice)
      Creates a new ILcdGLDrawable with the specified capabilities for the given GraphicsDevice. This method can be used in multi-monitor environments to create a drawable for a specific display device.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aGLCapabilities - an ILcdGLCapabilities
      aGraphicsDevice - a GraphicsDevice
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createGLDrawable

      default TLcdGLDrawableHolder createGLDrawable(ILcdGLCapabilities aGLCapabilities, ILcdGLCapabilitiesChooser aGLCapabilitiesChooser)
      Creates a new ILcdGLDrawable with the specified capabilities. The supplied ILcdGLCapabilitiesChooser will be used to choose an ILcdGLCapabilities from the list of capabilities supported by the underlying graphics hardware.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aGLCapabilities - an ILcdGLCapabilities
      aGLCapabilitiesChooser - an ILcdGLCapabilitiesChooser
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createGLDrawable

      default TLcdGLDrawableHolder createGLDrawable(ILcdGLCapabilities aGLCapabilities, ILcdGLCapabilitiesChooser aGLCapabilitiesChooser, GraphicsDevice aGraphicsDevice)
      Creates a new ILcdGLDrawable with the specified capabilities for the given GraphicsDevice. This method can be used in multi-monitor environments to create a drawable for a specific display device. The supplied ILcdGLCapabilitiesChooser will be used to choose an ILcdGLCapabilities from the list of capabilities supported by the underlying graphics hardware.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aGLCapabilities - an ILcdGLCapabilities
      aGLCapabilitiesChooser - an ILcdGLCapabilitiesChooser
      aGraphicsDevice - a GraphicsDevice
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createGLDrawable

      TLcdGLDrawableHolder createGLDrawable(ILcdGLCapabilities aGLCapabilities, ILcdGLCapabilitiesChooser aGLCapabilitiesChooser, GraphicsDevice aGraphicsDevice, ILcdGLDrawable aShareWith)
      Creates a new ILcdGLDrawable with the specified capabilities for the given GraphicsDevice. This method can be used in multi-monitor environments to create a drawable for a specific display device. The supplied ILcdGLCapabilitiesChooser will be used to choose an ILcdGLCapabilities from the list of capabilities supported by the underlying graphics hardware. Additionally, an existing ILcdGLDrawable can be supplied with which the new drawable should perform context sharing. Context sharing enables the use of OpenGL resources such as texture objects across multiple drawables.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aGLCapabilities - an ILcdGLCapabilities
      aGLCapabilitiesChooser - an ILcdGLCapabilitiesChooser
      aGraphicsDevice - a GraphicsDevice
      aShareWith - an existing ILcdGLDrawable to do context sharing with
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createLightweightGLDrawable

      default TLcdGLDrawableHolder createLightweightGLDrawable()
      Creates a new ILcdGLDrawable with default capabilities.
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createLightweightGLDrawable

      default TLcdGLDrawableHolder createLightweightGLDrawable(ILcdGLCapabilities aGLCapabilities)
      Creates a new ILcdGLDrawable with the specified capabilities.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aGLCapabilities - an ILcdGLCapabilities
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createLightweightGLDrawable

      default TLcdGLDrawableHolder createLightweightGLDrawable(ILcdGLCapabilities aGLCapabilities, ILcdGLCapabilitiesChooser aGLCapabilitiesChooser)
      Creates a new ILcdGLDrawable with the specified capabilities. The supplied ILcdGLCapabilitiesChooser will be used to choose an ILcdGLCapabilities from the list of capabilities supported by the underlying graphics hardware.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aGLCapabilities - an ILcdGLCapabilities
      aGLCapabilitiesChooser - an ILcdGLCapabilitiesChooser
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createLightweightGLDrawable

      default TLcdGLDrawableHolder createLightweightGLDrawable(GraphicsDevice aGraphicsDevice)
      Creates an ILcdGLDrawable with default capabilities for the specified GraphicsDevice. This method can be used in multi-monitor environments to create a drawable for a specific display device.
      Parameters:
      aGraphicsDevice - a GraphicsDevice
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createLightweightGLDrawable

      default TLcdGLDrawableHolder createLightweightGLDrawable(ILcdGLCapabilities aGLCapabilities, GraphicsDevice aGraphicsDevice)
      Creates a new ILcdGLDrawable with the specified capabilities for the given GraphicsDevice. This method can be used in multi-monitor environments to create a drawable for a specific display device.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aGLCapabilities - an ILcdGLCapabilities
      aGraphicsDevice - a GraphicsDevice
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createLightweightGLDrawable

      default TLcdGLDrawableHolder createLightweightGLDrawable(ILcdGLCapabilities aGLCapabilities, ILcdGLCapabilitiesChooser aGLCapabilitiesChooser, GraphicsDevice aGraphicsDevice)
      Creates a new ILcdGLDrawable with the specified capabilities for the given GraphicsDevice. This method can be used in multi-monitor environments to create a drawable for a specific display device. The supplied ILcdGLCapabilitiesChooser will be used to choose an ILcdGLCapabilities from the list of capabilities supported by the underlying graphics hardware.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aGLCapabilities - an ILcdGLCapabilities
      aGLCapabilitiesChooser - an ILcdGLCapabilitiesChooser
      aGraphicsDevice - a GraphicsDevice
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createLightweightGLDrawable

      TLcdGLDrawableHolder createLightweightGLDrawable(ILcdGLCapabilities aGLCapabilities, ILcdGLCapabilitiesChooser aGLCapabilitiesChooser, GraphicsDevice aGraphicsDevice, ILcdGLDrawable aShareWith)
      Creates a new ILcdGLDrawable with the specified capabilities for the given GraphicsDevice. This method can be used in multi-monitor environments to create a drawable for a specific display device. The supplied ILcdGLCapabilitiesChooser will be used to choose an ILcdGLCapabilities from the list of capabilities supported by the underlying graphics hardware. Additionally, an existing ILcdGLDrawable can be supplied with which the new drawable should perform context sharing. Context sharing enables the use of OpenGL resources such as texture objects across multiple drawables.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aGLCapabilities - an ILcdGLCapabilities
      aGLCapabilitiesChooser - an ILcdGLCapabilitiesChooser
      aGraphicsDevice - a GraphicsDevice
      aShareWith - an existing ILcdGLDrawable to do context sharing with
      Returns:
      a TLcdGLDrawableHolder containing the new ILcdGLDrawable
    • createGLOffScreenDrawable

      default ILcdGLOffScreenDrawable createGLOffScreenDrawable(int aWidth, int aHeight)
      Creates a new offscreen ILcdGLDrawable with the specified size and default capabilities.
      Parameters:
      aWidth - the initial width of the drawable (in pixels)
      aHeight - the initial height of the drawable (in pixels)
      Returns:
      an ILcdGLOffScreenDrawable
    • createGLOffScreenDrawable

      default ILcdGLOffScreenDrawable createGLOffScreenDrawable(int aWidth, int aHeight, ILcdGLCapabilities aGLCapabilities)
      Creates a new offscreen ILcdGLDrawable with the specified size and capabilities.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aWidth - the initial width of the drawable (in pixels)
      aHeight - the initial height of the drawable (in pixels)
      aGLCapabilities - an ILcdGLCapabilities
      Returns:
      an ILcdGLOffScreenDrawable
    • createGLOffScreenDrawable

      default ILcdGLOffScreenDrawable createGLOffScreenDrawable(int aWidth, int aHeight, ILcdGLCapabilities aGLCapabilities, ILcdGLCapabilitiesChooser aGLCapabilitiesChooser)
      Creates a new offscreen ILcdGLDrawable with the specified size and capabilities. The supplied ILcdGLCapabilitiesChooser will be used to choose an ILcdGLCapabilities from the list of capabilities supported by the underlying graphics hardware.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aWidth - the initial width of the drawable (in pixels)
      aHeight - the initial height of the drawable (in pixels)
      aGLCapabilities - an ILcdGLCapabilities
      aGLCapabilitiesChooser - an ILcdGLCapabilitiesChooser
      Returns:
      an ILcdGLOffScreenDrawable
    • createGLOffScreenDrawable

      ILcdGLOffScreenDrawable createGLOffScreenDrawable(int aWidth, int aHeight, ILcdGLCapabilities aGLCapabilities, ILcdGLCapabilitiesChooser aGLCapabilitiesChooser, ILcdGLDrawable aShareWith)
      Creates a new offscreen ILcdGLDrawable with the specified size and capabilities. The supplied ILcdGLCapabilitiesChooser will be used to choose an ILcdGLCapabilities from the list of capabilities supported by the underlying graphics hardware. Additionally, an existing ILcdGLDrawable can be supplied with which the new drawable should perform context sharing. Context sharing enables the use of OpenGL resources such as texture objects across multiple drawables.

      Note that the values in ILcdGLCapabilities are considered to be hints: there is no guarantee that the requested color depths, framebuffer layouts or other settings will effectively be available when the drawable is created.

      Parameters:
      aWidth - the initial width of the drawable (in pixels)
      aHeight - the initial height of the drawable (in pixels)
      aGLCapabilities - an ILcdGLCapabilities
      aGLCapabilitiesChooser - an ILcdGLCapabilitiesChooser
      aShareWith - an existing ILcdGLDrawable to do context sharing with
      Returns:
      an ILcdGLOffScreenDrawable
    • createExternalGLDrawable

      ILcdGLExternalDrawable createExternalGLDrawable()
      Creates a new ILcdGLDrawable for an externally supplied OpenGL context. See ILcdGLExternalDrawable for more information.
      Returns:
      a drawable for the current (pre-existing) OpenGL context
    • isContextSharingSupported

      default boolean isContextSharingSupported()
      Indicates whether this OpenGL binding can support GL context sharing.
      Returns:
      true if this OpenGL binding supports GL context sharing
      Since:
      2018.1
    • createJavaFXDrawable

      default ILcdGLDrawable createJavaFXDrawable()
      Creates a new ILcdGLDrawable for use in JavaFX applications.
      Returns:
      a new ILcdGLDrawable that can be cast to a JavaFX Node.
      Since:
      2020.0
    • createJavaFXDrawable

      default ILcdGLDrawable createJavaFXDrawable(int aWidth, int aHeight)
      Creates a new ILcdGLDrawable with the specified size, for use in JavaFX applications.
      Returns:
      a new ILcdGLDrawable that can be cast to a JavaFX Node.
      Since:
      2020.0