public abstract class X11GLContext extends GLContextImpl
Modifier and Type | Field and Description |
---|---|
protected long |
context |
protected X11GLDrawable |
drawable |
protected long |
mostRecentDisplay |
DEBUG, functionAvailability, gl, lock, NO_FREE, optimizationEnabled, VERBOSE
CONTEXT_CURRENT, CONTEXT_CURRENT_NEW, CONTEXT_NOT_CURRENT
Constructor and Description |
---|
X11GLContext(X11GLDrawable drawable,
GLContext shareWith) |
Modifier and Type | Method and Description |
---|---|
void |
bindPbufferToTexture()
Pbuffer support; given that this is a GLContext associated with a
pbuffer, binds this pbuffer to its texture target.
|
void |
copy(GLContext source,
int mask)
Copies selected groups of OpenGL state variables from the
supplied source context into this one.
|
protected abstract void |
create()
Helper routine which usually just turns around and calls
createContext (except for pbuffers, which use a different context
creation mechanism).
|
protected void |
createContext(boolean onscreen)
Creates and initializes an appropriate OpenGL context.
|
protected void |
destroyImpl() |
long |
getContext() |
GLDrawable |
getGLDrawable()
Returns the GLDrawable to which this context may be used to
draw.
|
GLXExt |
getGLXExt() |
GLXExtProcAddressTable |
getGLXExtProcAddressTable() |
int |
getOffscreenContextPixelDataType()
Only called for offscreen contexts; needed by glReadPixels
|
int |
getOffscreenContextReadBuffer() |
String |
getPlatformExtensionsString()
Returns a non-null (but possibly empty) string containing the
space-separated list of available platform-dependent (e.g., WGL,
GLX) extensions.
|
Object |
getPlatformGLExtensions() |
ByteBuffer |
glAllocateMemoryNV(int arg0,
float arg1,
float arg2,
float arg3) |
boolean |
isCreated()
Indicates whether the underlying OpenGL context has been
created.
|
boolean |
isExtensionAvailable(String glExtensionName)
Returns true if the specified OpenGL extension can be
successfully called using this GL context given the current host (OpenGL
client) and display (OpenGL server) configuration.
|
protected boolean |
isFunctionAvailable(String glFunctionName)
Returns true if the specified OpenGL core- or extension-function can be
successfully called using this GL context given the current host (OpenGL
client) and display (OpenGL server) configuration.
|
boolean |
isOptimizable() |
protected void |
lockToolkit() |
protected int |
makeCurrentImpl() |
protected String |
mapToRealGLExtensionName(String glExtensionName)
Maps the given "platform-independent" extension name to a real
function name.
|
protected String |
mapToRealGLFunctionName(String glFunctionName)
Maps the given "platform-independent" function name to a real function
name.
|
boolean |
offscreenImageNeedsVerticalFlip()
On some platforms the mismatch between OpenGL's coordinate
system (origin at bottom left) and the window system's
coordinate system (origin at top left) necessitates a vertical
flip of pixels read from offscreen contexts.
|
protected void |
releaseImpl() |
void |
releasePbufferFromTexture()
Pbuffer support; given that this is a GLContext associated with a
pbuffer, releases this pbuffer from its texture target.
|
protected void |
resetGLFunctionAvailability()
Resets the cache of which GL functions are available for calling through this
context.
|
void |
setSwapInterval(int interval) |
protected void |
unlockToolkit() |
createGL, destroy, getBufferSizeTracker, getDeletedObjectTracker, getFloatingPointMode, getGL, getGLProcAddressTable, getObjectTracker, getThreadName, hasWaiters, isSynchronized, makeCurrent, release, resetProcAddressTable, setBufferSizeTracker, setDeletedObjectTracker, setGL, setObjectTracker, setSynchronized, toHexString, update
getCurrent, setCurrent
protected X11GLDrawable drawable
protected long context
protected long mostRecentDisplay
public X11GLContext(X11GLDrawable drawable, GLContext shareWith)
public Object getPlatformGLExtensions()
getPlatformGLExtensions
in class GLContextImpl
public GLXExt getGLXExt()
public GLDrawable getGLDrawable()
GLContext
getGLDrawable
in class GLContext
protected String mapToRealGLFunctionName(String glFunctionName)
GLContextImpl
mapToRealGLFunctionName
in class GLContextImpl
protected String mapToRealGLExtensionName(String glExtensionName)
GLContextImpl
mapToRealGLExtensionName
in class GLContextImpl
protected abstract void create()
makeCurrentImpl()
.protected void createContext(boolean onscreen)
create()
.protected int makeCurrentImpl() throws GLException
makeCurrentImpl
in class GLContextImpl
GLException
protected void releaseImpl() throws GLException
releaseImpl
in class GLContextImpl
GLException
protected void destroyImpl() throws GLException
destroyImpl
in class GLContextImpl
GLException
public boolean isCreated()
GLContextImpl
isCreated
in class GLContextImpl
public void copy(GLContext source, int mask) throws GLException
GLContext
mask
parameter indicates which groups of state variables are to be
copied. mask
contains the bitwise OR of the same
symbolic names that are passed to the GL command glPushAttrib
. The single symbolic constant
GL_ALL_ATTRIB_BITS
can be used to
copy the maximum possible portion of rendering state.
Not all values for GL state can be copied. For example, pixel
pack and unpack state, render mode state, and select and feedback
state are not copied. The state that can be copied is exactly the
state that is manipulated by the GL command glPushAttrib
.
On most platforms, this context may not be current to any thread, including the calling thread, when this method is called. Some platforms have additional requirements such as whether this context or the source context must occasionally be made current in order for the results of the copy to be seen; these requirements are beyond the scope of this specification.
copy
in class GLContext
source
- the source OpenGL context from which to copy statemask
- a mask of symbolic names indicating which groups of state to copyGLException
- if an OpenGL-related error occurredprotected void resetGLFunctionAvailability()
GLContextImpl
GLContextImpl.isFunctionAvailable(String)
for more information on
the definition of "available".resetGLFunctionAvailability
in class GLContextImpl
public GLXExtProcAddressTable getGLXExtProcAddressTable()
public String getPlatformExtensionsString()
GLContextImpl
getPlatformExtensionsString
in class GLContextImpl
protected boolean isFunctionAvailable(String glFunctionName)
GLContextImpl
GL.isFunctionAvailable(String)
for more details.isFunctionAvailable
in class GLContextImpl
glFunctionName
- the name of the OpenGL function (e.g., use
"glPolygonOffsetEXT" to check if the javax.media.opengl.GL#glPolygonOffsetEXT(float,float)
is available).public boolean isExtensionAvailable(String glExtensionName)
GLContextImpl
GL.isExtensionAvailable(String)
for more details.isExtensionAvailable
in class GLContextImpl
glExtensionName
- the name of the OpenGL extension (e.g.,
"GL_VERTEX_PROGRAM_ARB").public void setSwapInterval(int interval)
setSwapInterval
in class GLContextImpl
public ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3)
glAllocateMemoryNV
in class GLContextImpl
public int getOffscreenContextPixelDataType()
GLContextImpl
getOffscreenContextPixelDataType
in class GLContextImpl
public int getOffscreenContextReadBuffer()
public boolean offscreenImageNeedsVerticalFlip()
GLContextImpl
offscreenImageNeedsVerticalFlip
in class GLContextImpl
public void bindPbufferToTexture()
GLContextImpl
bindPbufferToTexture
in class GLContextImpl
public void releasePbufferFromTexture()
GLContextImpl
releasePbufferFromTexture
in class GLContextImpl
public boolean isOptimizable()
isOptimizable
in class GLContextImpl
public long getContext()
protected void lockToolkit()
protected void unlockToolkit()
Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.