|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.media.opengl.GLDrawableFactory
com.sun.opengl.impl.GLDrawableFactoryImpl
com.sun.opengl.impl.x11.X11GLDrawableFactory
public class X11GLDrawableFactory
Constructor Summary | |
---|---|
X11GLDrawableFactory()
|
Method Summary | |
---|---|
static GLCapabilities |
attribList2GLCapabilities(int[] iattribs,
int niattribs,
int[] ivalues,
boolean pbuffer)
|
boolean |
canCreateContextOnJava2DSurface()
|
boolean |
canCreateExternalGLDrawable()
Returns true if it is possible to create an external GLDrawable object via GLDrawableFactory.createExternalGLDrawable() . |
boolean |
canCreateGLPbuffer()
Returns true if it is possible to create a GLPbuffer. |
AbstractGraphicsConfiguration |
chooseGraphicsConfiguration(GLCapabilities capabilities,
GLCapabilitiesChooser chooser,
AbstractGraphicsDevice absDevice)
Selects a graphics configuration on the specified graphics device compatible with the supplied GLCapabilities. |
GLContext |
createContextOnJava2DSurface(java.awt.Graphics g,
GLContext shareWith)
|
GLContext |
createExternalGLContext()
Creates a GLContext object representing an existing OpenGL context in an external (third-party) OpenGL-based library. |
GLDrawable |
createExternalGLDrawable()
Creates a GLDrawable object representing an existing
OpenGL drawable in an external (third-party) OpenGL-based
library. |
GLPbuffer |
createGLPbuffer(GLCapabilities capabilities,
GLCapabilitiesChooser chooser,
int initialWidth,
int initialHeight,
GLContext shareWith)
Creates a GLPbuffer with the given capabilites and dimensions. |
GLDrawableImpl |
createOffscreenDrawable(GLCapabilities capabilities,
GLCapabilitiesChooser chooser)
Creates a (typically software-accelerated) offscreen GLDrawable used to implement the fallback rendering path of the GLJPanel. |
long |
dynamicLookupFunction(java.lang.String glFuncName)
Dynamically looks up the given function. |
static long |
getDisplayConnection()
|
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. |
GLDrawable |
getGLDrawable(java.lang.Object target,
GLCapabilities capabilities,
GLCapabilitiesChooser chooser)
Returns a GLDrawable that wraps a platform-specific window system object, such as an AWT or LCDUI Canvas. |
static X11GLDrawableFactory |
getX11Factory()
|
static int[] |
glCapabilities2AttribList(GLCapabilities caps,
boolean isMultisampleAvailable,
boolean pbuffer,
long display,
int screen)
|
static int |
glXGetConfig(long display,
XVisualInfo info,
int attrib,
int[] tmp,
int tmp_offset)
|
static boolean |
isMultisampleAvailable()
|
static boolean |
isVendorATI()
Workaround for apparent issue with ATI's proprietary drivers where direct contexts still send GLX tokens for GL calls |
protected boolean |
isXineramaEnabled()
|
void |
loadGLULibrary()
|
void |
lockAWTForJava2D()
Locks the AWT for the purposes of Java2D/JOGL integration. |
void |
lockToolkit()
|
protected void |
resetGammaRamp(java.nio.Buffer originalGammaRamp)
Resets the gamma ramp, potentially using the specified Buffer as data to restore the original values. |
protected boolean |
setGammaRamp(float[] ramp)
Sets the gamma ramp for the main screen. |
void |
unlockAWTForJava2D()
Unlocks the AWT for the purposes of Java2D/JOGL integration. |
void |
unlockToolkit()
|
static GLCapabilities |
xvi2GLCapabilities(long display,
XVisualInfo info)
|
Methods inherited from class com.sun.opengl.impl.GLDrawableFactoryImpl |
---|
getFactoryImpl, resetDisplayGamma, setDisplayGamma |
Methods inherited from class javax.media.opengl.GLDrawableFactory |
---|
getFactory |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public X11GLDrawableFactory()
Method Detail |
---|
public AbstractGraphicsConfiguration chooseGraphicsConfiguration(GLCapabilities capabilities, GLCapabilitiesChooser chooser, AbstractGraphicsDevice absDevice)
GLDrawableFactory
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 class GLDrawableFactory
Canvas.Canvas(java.awt.GraphicsConfiguration)
public GLDrawable getGLDrawable(java.lang.Object target, GLCapabilities capabilities, GLCapabilitiesChooser chooser)
GLDrawableFactory
getGLDrawable
in class GLDrawableFactory
public GLDrawableImpl createOffscreenDrawable(GLCapabilities capabilities, GLCapabilitiesChooser chooser)
GLDrawableFactoryImpl
createOffscreenDrawable
in class GLDrawableFactoryImpl
public boolean canCreateGLPbuffer()
GLDrawableFactory
canCreateGLPbuffer
in class GLDrawableFactory
public GLPbuffer createGLPbuffer(GLCapabilities capabilities, GLCapabilitiesChooser chooser, int initialWidth, int initialHeight, GLContext shareWith)
GLDrawableFactory
See the note in the overview documentation on context sharing.
createGLPbuffer
in class GLDrawableFactory
public GLContext createExternalGLContext()
GLDrawableFactory
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 class GLDrawableFactory
public boolean canCreateExternalGLDrawable()
GLDrawableFactory
GLDrawableFactory.createExternalGLDrawable()
.
canCreateExternalGLDrawable
in class GLDrawableFactory
public GLDrawable createExternalGLDrawable()
GLDrawableFactory
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(javax.media.opengl.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 class GLDrawableFactory
public void loadGLULibrary()
loadGLULibrary
in class GLDrawableFactoryImpl
public long dynamicLookupFunction(java.lang.String glFuncName)
GLDrawableFactoryImpl
dynamicLookupFunction
in class GLDrawableFactoryImpl
public static GLCapabilities xvi2GLCapabilities(long display, XVisualInfo info)
public static int[] glCapabilities2AttribList(GLCapabilities caps, boolean isMultisampleAvailable, boolean pbuffer, long display, int screen)
public static GLCapabilities attribList2GLCapabilities(int[] iattribs, int niattribs, int[] ivalues, boolean pbuffer)
public void lockToolkit()
public void unlockToolkit()
public void lockAWTForJava2D()
GLDrawableFactoryImpl
lockAWTForJava2D
in class GLDrawableFactoryImpl
public void unlockAWTForJava2D()
GLDrawableFactoryImpl
unlockAWTForJava2D
in class GLDrawableFactoryImpl
public static long getDisplayConnection()
public static boolean isMultisampleAvailable()
public static int glXGetConfig(long display, XVisualInfo info, int attrib, int[] tmp, int tmp_offset)
public static X11GLDrawableFactory getX11Factory()
public static boolean isVendorATI()
public boolean canCreateContextOnJava2DSurface()
canCreateContextOnJava2DSurface
in class GLDrawableFactoryImpl
public GLContext createContextOnJava2DSurface(java.awt.Graphics g, GLContext shareWith) throws GLException
createContextOnJava2DSurface
in class GLDrawableFactoryImpl
GLException
protected boolean isXineramaEnabled()
protected int getGammaRampLength()
GLDrawableFactoryImpl
getGammaRampLength
in class GLDrawableFactoryImpl
protected boolean setGammaRamp(float[] ramp)
GLDrawableFactoryImpl
setGammaRamp
in class GLDrawableFactoryImpl
protected java.nio.Buffer getGammaRamp()
GLDrawableFactoryImpl
getGammaRamp
in class GLDrawableFactoryImpl
protected void resetGammaRamp(java.nio.Buffer originalGammaRamp)
GLDrawableFactoryImpl
resetGammaRamp
in class GLDrawableFactoryImpl
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |