com.sun.opengl.impl

Class GLDrawableFactoryImpl

Implemented Interfaces:
DynamicLookupHelper
Known Direct Subclasses:
X11GLDrawableFactory

public abstract class GLDrawableFactoryImpl
extends GLDrawableFactory
implements DynamicLookupHelper

Extends GLDrawableFactory with a few methods for handling typically software-accelerated offscreen rendering (Device Independent Bitmaps on Windows, pixmaps on X11). Direct access to these GLDrawables is not supplied directly to end users, though they may be instantiated by the GLJPanel implementation.

Method Summary

abstract GLDrawableImpl
createOffscreenDrawable(GLCapabilities capabilities, GLCapabilitiesChooser chooser)
Creates a (typically software-accelerated) offscreen GLDrawable used to implement the fallback rendering path of the GLJPanel.
abstract long
dynamicLookupFunction(String glFuncName)
Dynamically looks up the given function.
static GLDrawableFactoryImpl
getFactoryImpl()
protected Buffer
getGammaRamp()
Gets the current gamma ramp.
protected int
getGammaRampLength()
Returns the length of the computed gamma ramp for this OS and hardware.
abstract void
loadGLULibrary()
abstract void
lockAWTForJava2D()
Locks the AWT for the purposes of Java2D/JOGL integration.
void
resetDisplayGamma()
protected void
resetGammaRamp(Buffer originalGammaRamp)
Resets the gamma ramp, potentially using the specified Buffer as data to restore the original values.
boolean
setDisplayGamma(float gamma, float brightness, float contrast)
Sets the gamma, brightness, and contrast of the current main display.
protected boolean
setGammaRamp(float[] ramp)
Sets the gamma ramp for the main screen.
abstract void
unlockAWTForJava2D()
Unlocks the AWT for the purposes of Java2D/JOGL integration.

Methods inherited from class javax.media.opengl.GLDrawableFactory

canCreateExternalGLDrawable, canCreateGLPbuffer, chooseGraphicsConfiguration, createExternalGLContext, createExternalGLDrawable, createGLPbuffer, getFactory, getGLDrawable

Method Details

createOffscreenDrawable

public abstract GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities,
                                                       GLCapabilitiesChooser chooser)
Creates a (typically software-accelerated) offscreen GLDrawable used to implement the fallback rendering path of the GLJPanel.

dynamicLookupFunction

public abstract long dynamicLookupFunction(String glFuncName)
Dynamically looks up the given function.

getFactoryImpl

public static GLDrawableFactoryImpl getFactoryImpl()

getGammaRamp

protected Buffer getGammaRamp()
Gets the current gamma ramp. This is basically an opaque value used only on some platforms to reset the gamma ramp to its original settings.

getGammaRampLength

protected int getGammaRampLength()
Returns the length of the computed gamma ramp for this OS and hardware. Returns 0 if gamma changes are not supported.

loadGLULibrary

public abstract void loadGLULibrary()

lockAWTForJava2D

public abstract void lockAWTForJava2D()
Locks the AWT for the purposes of Java2D/JOGL integration. This is not necessary on some platforms.

resetDisplayGamma

public void resetDisplayGamma()

resetGammaRamp

protected void resetGammaRamp(Buffer originalGammaRamp)
Resets the gamma ramp, potentially using the specified Buffer as data to restore the original values.

setDisplayGamma

public boolean setDisplayGamma(float gamma,
                               float brightness,
                               float contrast)
            throws IllegalArgumentException
Sets the gamma, brightness, and contrast of the current main display. Returns true if the settings were changed, false if not. If this method returns true, the display settings will automatically be reset upon JVM exit (assuming the JVM does not crash); if the user wishes to change the display settings back to normal ahead of time, use resetDisplayGamma(). Throws IllegalArgumentException if any of the parameters were out-of-bounds.
Parameters:
gamma - The gamma value, typically > 1.0 (default value is 1.0)
brightness - The brightness value between -1.0 and 1.0, inclusive (default value is 0)
contrast - The contrast, greater than 0.0 (default value is 1)

setGammaRamp

protected boolean setGammaRamp(float[] ramp)
Sets the gamma ramp for the main screen. Returns false if gamma ramp changes were not supported.

unlockAWTForJava2D

public abstract void unlockAWTForJava2D()
Unlocks the AWT for the purposes of Java2D/JOGL integration. This is not necessary on some platforms.

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