com.sun.opengl.impl
Class GLDrawableFactoryImpl

java.lang.Object
  extended by javax.media.opengl.GLDrawableFactory
      extended by com.sun.opengl.impl.GLDrawableFactoryImpl
Direct Known Subclasses:
X11GLDrawableFactory

public abstract class GLDrawableFactoryImpl
extends GLDrawableFactory

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.


Constructor Summary
GLDrawableFactoryImpl()
           
 
Method Summary
abstract  boolean canCreateContextOnJava2DSurface()
           
abstract  GLContext createContextOnJava2DSurface(java.awt.Graphics g, GLContext shareWith)
           
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(java.lang.String glFuncName)
          Dynamically looks up the given function.
static GLDrawableFactoryImpl getFactoryImpl()
           
protected  java.nio.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(java.nio.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GLDrawableFactoryImpl

public GLDrawableFactoryImpl()
Method Detail

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(java.lang.String glFuncName)
Dynamically looks up the given function.


lockAWTForJava2D

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


unlockAWTForJava2D

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


getFactoryImpl

public static GLDrawableFactoryImpl getFactoryImpl()

loadGLULibrary

public abstract void loadGLULibrary()

canCreateContextOnJava2DSurface

public abstract boolean canCreateContextOnJava2DSurface()

createContextOnJava2DSurface

public abstract GLContext createContextOnJava2DSurface(java.awt.Graphics g,
                                                       GLContext shareWith)
                                                throws GLException
Throws:
GLException

setDisplayGamma

public boolean setDisplayGamma(float gamma,
                               float brightness,
                               float contrast)
                        throws java.lang.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)
Throws:
java.lang.IllegalArgumentException - if any of the parameters were out-of-bounds

resetDisplayGamma

public void resetDisplayGamma()

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.


setGammaRamp

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


getGammaRamp

protected java.nio.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.


resetGammaRamp

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



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