|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.opengl.GLDrawableFactory
com.jogamp.opengl.impl.GLDrawableFactoryImpl
public abstract class GLDrawableFactoryImpl
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.
Field Summary | |
---|---|
protected static boolean |
DEBUG
|
Constructor Summary | |
---|---|
protected |
GLDrawableFactoryImpl()
|
Method Summary | |
---|---|
abstract boolean |
canCreateContextOnJava2DSurface(AbstractGraphicsDevice device)
|
abstract GLContext |
createContextOnJava2DSurface(Object graphics,
GLContext shareWith)
|
GLDrawable |
createGLDrawable(NativeWindow target)
Returns a GLDrawable according to it's chosen Capabilities, which determines pixel format, on- and offscreen incl. |
GLPbuffer |
createGLPbuffer(GLCapabilities capabilities,
GLCapabilitiesChooser chooser,
int width,
int height,
GLContext shareWith)
Creates a GLPbuffer with the given capabilites and dimensions. |
GLDrawable |
createGLPbufferDrawable(GLCapabilities capabilities,
GLCapabilitiesChooser chooser,
int width,
int height)
Creates a Pbuffer GLDrawable with the given capabilites and dimensions. |
protected GLDrawableImpl |
createGLPbufferDrawable(NativeWindow target)
|
protected abstract GLDrawableImpl |
createGLPbufferDrawableImpl(NativeWindow target)
Target must implement SurfaceChangeable |
GLDrawable |
createOffscreenDrawable(GLCapabilities capabilities,
GLCapabilitiesChooser chooser,
int width,
int height)
Creates a Offscreen GLDrawable with the given capabilites and dimensions. |
protected abstract GLDrawableImpl |
createOffscreenDrawable(NativeWindow target)
|
protected abstract NativeWindow |
createOffscreenWindow(GLCapabilities capabilities,
GLCapabilitiesChooser chooser,
int width,
int height)
creates an offscreen NativeWindow, which must implement SurfaceChangeable as well, so the windowing system related implementation is able to set the surface handle. |
protected abstract GLDrawableImpl |
createOnscreenDrawable(NativeWindow target)
|
static GLDrawableFactoryImpl |
getFactoryImpl(GLProfile glp)
Returns the sole GLDrawableFactoryImpl instance. |
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 GLDynamicLookupHelper |
getGLDynamicLookupHelper(int profile)
Returns the GLDynamicLookupHelper |
protected abstract GLContextImpl |
getSharedContext()
|
protected abstract GLDrawableImpl |
getSharedDrawable()
|
protected void |
maybeDoSingleThreadedWorkaround(Runnable action)
|
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. |
protected abstract void |
shutdown()
|
Methods inherited from class javax.media.opengl.GLDrawableFactory |
---|
canCreateExternalGLDrawable, canCreateGLPbuffer, createExternalGLContext, createExternalGLDrawable, getFactory, getFactoryImpl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final boolean DEBUG
Constructor Detail |
---|
protected GLDrawableFactoryImpl()
Method Detail |
---|
public abstract GLDynamicLookupHelper getGLDynamicLookupHelper(int profile)
profile
- if EGL/ES, profile 1
refers to ES1 and 2
to ES2,
otherwise the profile is ignored.public GLDrawable createGLDrawable(NativeWindow target)
GLDrawableFactory
The native platform's chosen Capabilties are referenced within the target NativeWindow's AbstractGraphicsConfiguration.
In case Capabilities.isOnscreen()
is true,
an onscreen GLDrawable will be realized.
In case Capabilities.isOnscreen()
is false,
either a Pbuffer drawable is created if GLCapabilities.isPBuffer()
is true,
or a simple offscreen drawable is creates. The latter is unlikely to be hardware accelerated.
createGLDrawable
in class GLDrawableFactory
GraphicsConfigurationFactory.chooseGraphicsConfiguration(Capabilities, CapabilitiesChooser, AbstractGraphicsScreen)
protected abstract GLDrawableImpl createOnscreenDrawable(NativeWindow target)
protected abstract GLDrawableImpl createGLPbufferDrawableImpl(NativeWindow target)
protected GLDrawableImpl createGLPbufferDrawable(NativeWindow target)
public GLDrawable createGLPbufferDrawable(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height)
GLDrawableFactory
createGLPbufferDrawable
in class GLDrawableFactory
public GLPbuffer createGLPbuffer(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height, GLContext shareWith)
GLDrawableFactory
See the note in the overview documentation on context sharing.
createGLPbuffer
in class GLDrawableFactory
protected abstract GLDrawableImpl createOffscreenDrawable(NativeWindow target)
public GLDrawable createOffscreenDrawable(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height)
GLDrawableFactory
createOffscreenDrawable
in class GLDrawableFactory
protected abstract NativeWindow createOffscreenWindow(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int width, int height)
protected abstract GLDrawableImpl getSharedDrawable()
protected abstract GLContextImpl getSharedContext()
protected abstract void shutdown()
protected void maybeDoSingleThreadedWorkaround(Runnable action)
public static GLDrawableFactoryImpl getFactoryImpl(GLProfile glp)
glProfile
- GLProfile to determine the factory type, ie EGLDrawableFactory,
or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.public abstract boolean canCreateContextOnJava2DSurface(AbstractGraphicsDevice device)
public abstract GLContext createContextOnJava2DSurface(Object graphics, GLContext shareWith) throws GLException
GLException
public boolean setDisplayGamma(float gamma, float brightness, float contrast) throws IllegalArgumentException
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)
IllegalArgumentException
- if any of the parameters were
out-of-boundspublic void resetDisplayGamma()
protected int getGammaRampLength()
protected boolean setGammaRamp(float[] ramp)
protected Buffer getGammaRamp()
protected void resetGammaRamp(Buffer originalGammaRamp)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |