Class GLDrawableFactory


  • public abstract class GLDrawableFactory
    extends Object

    Provides a virtual machine- and operating system-independent mechanism for creating GLDrawables.

    The GLCapabilities objects passed in to the various factory methods are used as a hint for the properties of the returned drawable. The default capabilities selection algorithm (equivalent to passing in a null GLCapabilitiesChooser) is described in DefaultGLCapabilitiesChooser. Sophisticated applications needing to change the selection algorithm may pass in their own GLCapabilitiesChooser which can select from the available pixel formats. The GLCapabilitiesChooser mechanism may not be supported by all implementations or on all platforms, in which case any passed GLCapabilitiesChooser will be ignored.

    Because of the multithreaded nature of the Java platform's Abstract Window Toolkit, it is typically not possible to immediately reject a given GLCapabilities as being unsupportable by either returning null from the creation routines or raising a GLException. The semantics of the rejection process are (unfortunately) left unspecified for now. The current implementation will cause a GLException to be raised during the first repaint of the GLCanvas or GLJPanel if the capabilities can not be met.
    GLOffscreenAutoDrawable are created lazily, see createOffscreenAutoDrawable(..).

    The concrete GLDrawableFactory subclass instantiated by getFactory can be changed by setting the system property opengl.factory.class.name to the fully-qualified name of the desired class.