Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## javax.media.nativewindow
Class GraphicsConfigurationFactory

    java.lang.Object
      javax.media.nativewindow.GraphicsConfigurationFactory

    public abstract class GraphicsConfigurationFactory

extends Object

Provides the mechanism by which the graphics configuration for a window can be chosen before the window is created. The graphics configuration decides parameters related to hardware accelerated rendering such as the OpenGL pixel format.
On some window systems (EGL/OpenKODE and X11 in particular) it is necessary to choose the graphics configuration early at window creation time.
Note that the selection of the graphics configuration is an algorithm which does not have strong dependencies on the particular Java window toolkit in use (e.g., AWT) and therefore it is strongly desirable to factor this functionality out of the core `NativeWindowFactory` so that new window toolkits can replace just the `NativeWindowFactory` and reuse the graphics configuration selection algorithm provided by, for example, an OpenGL binding.

Field Summary
`protected static boolean` | `DEBUG`

Constructor Summary
`protected` | `GraphicsConfigurationFactory()` Creates a new NativeWindowFactory instance.

Method Summary
`abstract AbstractGraphicsConfiguration` | `chooseGraphicsConfiguration(Capabilities capabilities, CapabilitiesChooser chooser, AbstractGraphicsScreen screen)` Selects a graphics configuration on the specified graphics device compatible with the supplied `Capabilities`.
`static GraphicsConfigurationFactory` | `getFactory(AbstractGraphicsDevice device)` Returns the factory for use with the given type of AbstractGraphicsDevice.
`static GraphicsConfigurationFactory` | `getFactory(Class abstractGraphicsDeviceImplementor)` Returns the graphics configuration factory for use with the given class, which must implement the `AbstractGraphicsDevice` interface.
`protected static void` | `registerFactory(Class abstractGraphicsDeviceImplementor, GraphicsConfigurationFactory factory)` Registers a GraphicsConfigurationFactory handling graphics device objects of the given class.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEBUG

    protected static final boolean DEBUG

Constructor Detail

### GraphicsConfigurationFactory

    protected GraphicsConfigurationFactory()

  Creates a new NativeWindowFactory instance. End users do not need to call this method.

Method Detail

### getFactory

    public static GraphicsConfigurationFactory getFactory(AbstractGraphicsDevice device)

  Returns the factory for use with the given type of AbstractGraphicsDevice.

### getFactory

    public static GraphicsConfigurationFactory getFactory(Class abstractGraphicsDeviceImplementor)
                                                   throws IllegalArgumentException,
                                                          NativeWindowException

  Returns the graphics configuration factory for use with the given class, which must implement the `AbstractGraphicsDevice` interface.

  Throws:
    `IllegalArgumentException` - if the given class does not implement AbstractGraphicsDevice
    `NativeWindowException`

### registerFactory

    protected static void registerFactory(Class abstractGraphicsDeviceImplementor,
                                          GraphicsConfigurationFactory factory)
                                   throws IllegalArgumentException

  Registers a GraphicsConfigurationFactory handling graphics device objects of the given class. This does not need to be called by end users, only implementors of new GraphicsConfigurationFactory subclasses.

  Throws:
    `IllegalArgumentException` - if the given class does not implement AbstractGraphicsDevice

### chooseGraphicsConfiguration

    public abstract AbstractGraphicsConfiguration chooseGraphicsConfiguration(Capabilities capabilities,
                                                                              CapabilitiesChooser chooser,
                                                                              AbstractGraphicsScreen screen)
                                                                       throws IllegalArgumentException,
                                                                              NativeWindowException

  Selects a graphics configuration on the specified graphics device compatible with the supplied `Capabilities`. Some platforms (e.g.: X11, EGL, KD) require the graphics configuration to be specified when the native window is created. These architectures have seperated their device, screen, window and drawable context and hence are capable of quering the capabilities for each screen. A fully established window is not required.

  Other platforms (e.g. Windows, MacOSX) don't offer the mentioned seperation and hence need a fully established window and it's drawable. Here the validation of the capabilities is performed later. In this case, the AbstractGraphicsConfiguration implementation must allow an overwrite of the Capabilites, for example `DefaultGraphicsConfiguration.setChosenCapabilities(..)`.

  This method is mainly intended to be both used and implemented by the OpenGL binding.

  The concrete data type of the passed graphics device and returned graphics configuration must be specified in the documentation binding this particular API to the underlying window toolkit. The Reference Implementation accepts `AWTGraphicsDevice` objects and returns `AWTGraphicsConfiguration` objects. On X11 platforms where the AWT is not in use, it also accepts `X11GraphicsDevice` objects and returns `X11GraphicsConfiguration` objects.

  Throws:
    `IllegalArgumentException` - if the data type of the passed AbstractGraphicsDevice is not supported by this NativeWindowFactory.
    `NativeWindowException` - if any window system-specific errors caused the selection of the graphics configuration to fail.
  See Also:
    `chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)`, `DefaultGraphicsConfiguration.setChosenCapabilities(Capabilities caps)`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.