canCreateGLPbuffer
public boolean canCreateGLPbuffer()
Returns true if it is possible to create a GLPbuffer. Some older
graphics cards do not have this capability.
- canCreateGLPbuffer in interface GLDrawableFactory
chooseGraphicsConfiguration
public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities,
GLCapabilitiesChooser chooser,
AbstractGraphicsDevice absDevice)
Selects a graphics configuration on the specified graphics
device compatible with the supplied GLCapabilities. This method
is intended to be used by applications which do not use the
supplied GLCanvas class but instead wrap their own Canvas or
other window toolkit-specific object with a GLDrawable. Some
platforms (specifically X11) require the graphics configuration
to be specified when the window toolkit object is created. This
method may return null on platforms on which the OpenGL pixel
format selection process is performed later.
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.
- chooseGraphicsConfiguration in interface GLDrawableFactory
createExternalGLContext
public GLContext createExternalGLContext()
Creates a GLContext object representing an existing OpenGL
context in an external (third-party) OpenGL-based library. This
GLContext object may be used to draw into this preexisting
context using its
GL
and
GLU
objects. New contexts created through
GLDrawable
s may share textures and display lists with
this external context.
The underlying OpenGL context must be current on the current
thread at the time this method is called. The user is responsible
for the maintenance of the underlying OpenGL context; calls to
makeCurrent
and
release
on the returned
GLContext object have no effect. If the underlying OpenGL context
is destroyed, the
destroy
method should be called on
the
GLContext
. A new
GLContext
object
should be created for each newly-created underlying OpenGL
context.
- createExternalGLContext in interface GLDrawableFactory
createExternalGLDrawable
public GLDrawable createExternalGLDrawable()
Creates a
GLDrawable
object representing an existing
OpenGL drawable in an external (third-party) OpenGL-based
library. This GLDrawable object may be used to create new,
fully-functional
GLContext
s on the OpenGL drawable. This
is useful when interoperating with a third-party OpenGL-based
library and it is essential to not perturb the state of the
library's existing context, even to the point of not sharing
textures or display lists with that context.
An underlying OpenGL context must be current on the desired
drawable and the current thread at the time this method is
called. The user is responsible for the maintenance of the
underlying drawable. If one or more contexts are created on the
drawable using
GLDrawable.createContext(GLContext)
, and the drawable
is deleted by the third-party library, the user is responsible
for calling
GLContext.destroy()
on these contexts.
Calls to
setSize
,
getWidth
and
getHeight
are illegal on the returned GLDrawable. If
these operations are required by the user, they must be performed
by the third-party library.
It is legal to create both an external GLContext and
GLDrawable representing the same third-party OpenGL entities.
This can be used, for example, to query current state information
using the external GLContext and then create and set up new
GLContexts using the external GLDrawable.
This functionality may not be available on all platforms and
GLDrawableFactory.canCreateExternalGLDrawable()
should be called first to
see if it is present. For example, on X11 platforms, this API
requires the presence of GLX 1.3 or later.
- createExternalGLDrawable in interface GLDrawableFactory
getDisplayConnection
public static long getDisplayConnection()
getGLDrawable
public GLDrawable getGLDrawable(Object target,
GLCapabilities capabilities,
GLCapabilitiesChooser chooser)
Returns a GLDrawable that wraps a platform-specific window system
object, such as an AWT or LCDUI Canvas. On platforms which
support it, selects a pixel format compatible with the supplied
GLCapabilities, or if the passed GLCapabilities object is null,
uses a default set of capabilities. On these platforms, uses
either the supplied GLCapabilitiesChooser object, or if the
passed GLCapabilitiesChooser object is null, uses a
DefaultGLCapabilitiesChooser instance.
- getGLDrawable in interface GLDrawableFactory
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.
- getGammaRamp in interface GLDrawableFactoryImpl
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.
- getGammaRampLength in interface GLDrawableFactoryImpl
glCapabilities2AttribList
public static int[] glCapabilities2AttribList(GLCapabilities caps,
boolean isMultisampleAvailable,
boolean pbuffer,
long display,
int screen)
glXGetConfig
public static int glXGetConfig(long display,
XVisualInfo info,
int attrib,
int[] tmp,
int tmp_offset)
isMultisampleAvailable
public static boolean isMultisampleAvailable()
isVendorATI
public static boolean isVendorATI()
Workaround for apparent issue with ATI's proprietary drivers
where direct contexts still send GLX tokens for GL calls
isXineramaEnabled
protected boolean isXineramaEnabled()
lockAWTForJava2D
public void lockAWTForJava2D()
Locks the AWT for the purposes of Java2D/JOGL integration. This
is not necessary on some platforms.
- lockAWTForJava2D in interface GLDrawableFactoryImpl
lockToolkit
public void lockToolkit()
resetGammaRamp
protected void resetGammaRamp(Buffer originalGammaRamp)
Resets the gamma ramp, potentially using the specified Buffer as
data to restore the original values.
- resetGammaRamp in interface GLDrawableFactoryImpl
setGammaRamp
protected boolean setGammaRamp(float[] ramp)
Sets the gamma ramp for the main screen. Returns false if gamma
ramp changes were not supported.
- setGammaRamp in interface GLDrawableFactoryImpl
unlockAWTForJava2D
public void unlockAWTForJava2D()
Unlocks the AWT for the purposes of Java2D/JOGL integration.
This is not necessary on some platforms.
- unlockAWTForJava2D in interface GLDrawableFactoryImpl
unlockToolkit
public void unlockToolkit()