DEBUG
protected static final boolean DEBUG
NO_FREE
protected static final boolean NO_FREE
VERBOSE
protected static final boolean VERBOSE
optimizationEnabled
protected boolean optimizationEnabled
bindPbufferToTexture
public abstract void bindPbufferToTexture()
Pbuffer support; given that this is a GLContext associated with a
pbuffer, binds this pbuffer to its texture target.
createGL
protected GL createGL()
Create the GL for this context.
destroy
public void destroy()
Destroys this OpenGL context and frees its associated
resources. The context should have been released before this
method is called.
- destroy in interface GLContext
destroyImpl
protected abstract void destroyImpl()
throws GLException
getFloatingPointMode
public int getFloatingPointMode()
throws GLException
Indicates which floating-point pbuffer implementation is in
use. Returns one of GLPbuffer.APPLE_FLOAT, GLPbuffer.ATI_FLOAT,
or GLPbuffer.NV_FLOAT.
getGL
public GL getGL()
Returns the GL pipeline object for this GLContext.
- getGL in interface GLContext
getOffscreenContextPixelDataType
public abstract int getOffscreenContextPixelDataType()
Only called for offscreen contexts; needed by glReadPixels
getPlatformExtensionsString
public abstract String getPlatformExtensionsString()
Returns a non-null (but possibly empty) string containing the
space-separated list of available platform-dependent (e.g., WGL,
GLX) extensions. Can only be called while this context is
current.
getPlatformGLExtensions
public abstract Object getPlatformGLExtensions()
getThreadName
protected static String getThreadName()
glAllocateMemoryNV
public abstract ByteBuffer glAllocateMemoryNV(int arg0,
float arg1,
float arg2,
float arg3)
hasWaiters
public boolean hasWaiters()
isCreated
public abstract boolean isCreated()
Indicates whether the underlying OpenGL context has been
created. This is used to manage sharing of display lists and
textures between contexts.
isExtensionAvailable
public 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.
See
GL.isExtensionAvailable(String)
for more details.
glExtensionName
- the name of the OpenGL extension (e.g.,
"GL_VERTEX_PROGRAM_ARB").
isFunctionAvailable
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.
See
GL.isFunctionAvailable(String)
for more details.
glFunctionName
- the name of the OpenGL function (e.g., use
"glPolygonOffsetEXT" to check if the javax.media.opengl.GL.glPolygonOffsetEXT(float,float)
is available).
isOptimizable
public boolean isOptimizable()
isSynchronized
public boolean isSynchronized()
Returns true if 'makeCurrent' will exhibit synchronized behavior.
- isSynchronized in interface GLContext
makeCurrent
public int makeCurrent()
throws GLException
Makes this GLContext current on the calling thread.
There are two return values that indicate success and one that
indicates failure. A return value of CONTEXT_CURRENT_NEW
indicates that that context has been made current, and that
this is the first time this context has been made current, or
that the state of the underlying context or drawable may have
changed since the last time this context was made current. In
this case, the application may wish to initialize the state. A
return value of CONTEXT_CURRENT indicates that the context has
been made currrent, with its previous state restored.
If the context could not be made current (for example, because
the underlying drawable has not ben realized on the display) ,
a value of CONTEXT_NOT_CURRENT is returned.
If the context is in use by another thread at the time of the
call, then if isSynchronized() is true the call will
block. If isSynchronized() is false, an exception will be
thrown and the context will remain current on the other thread.
- makeCurrent in interface GLContext
- CONTEXT_CURRENT if the context was successfully made current
GLException
- if synchronization is disabled and the
context is current on another thread, or because the context
could not be created or made current due to non-recoverable,
window system-specific errors.
makeCurrentImpl
protected abstract int makeCurrentImpl()
throws GLException
mapToRealGLExtensionName
protected abstract String mapToRealGLExtensionName(String glExtensionName)
Maps the given "platform-independent" extension name to a real
function name. Currently this is only used to map
"GL_ARB_pbuffer" and "GL_ARB_pixel_format" to "WGL_ARB_pbuffer"
and "WGL_ARB_pixel_format" (not yet mapped to X11).
mapToRealGLFunctionName
protected abstract String mapToRealGLFunctionName(String glFunctionName)
Maps the given "platform-independent" function name to a real function
name. Currently this is only used to map "glAllocateMemoryNV" and
associated routines to wglAllocateMemoryNV / glXAllocateMemoryNV.
offscreenImageNeedsVerticalFlip
public abstract 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.
release
public void release()
throws GLException
Releases control of this GLContext from the current thread.
- release in interface GLContext
GLException
- if the context had not previously been made
current on the current thread
releaseImpl
protected abstract void releaseImpl()
throws GLException
releasePbufferFromTexture
public abstract void releasePbufferFromTexture()
Pbuffer support; given that this is a GLContext associated with a
pbuffer, releases this pbuffer from its texture target.
resetGLFunctionAvailability
protected void resetGLFunctionAvailability()
Resets the cache of which GL functions are available for calling through this
context. See
isFunctionAvailable(String)
for more information on
the definition of "available".
resetProcAddressTable
protected void resetProcAddressTable(Object table)
Helper routine which resets a ProcAddressTable generated by the
GLEmitter by looking up anew all of its function pointers.
setDeletedObjectTracker
public void setDeletedObjectTracker(GLObjectTracker deletedObjectTracker)
setGL
public void setGL(GL gl)
Sets the GL pipeline object for this GLContext.
- setGL in interface GLContext
setSwapInterval
public void setSwapInterval(int interval)
setSynchronized
public void setSynchronized(boolean isSynchronized)
Determines whether 'makeCurrent' will exhibit synchronized behavior.
- setSynchronized in interface GLContext
toHexString
public static String toHexString(long hex)