public abstract class GLContextImpl extends GLContext
Modifier and Type | Field and Description |
---|---|
protected static boolean |
DEBUG |
protected FunctionAvailabilityCache |
functionAvailability |
protected GL |
gl |
protected GLContextLock |
lock |
protected static boolean |
NO_FREE |
protected boolean |
optimizationEnabled |
protected static boolean |
VERBOSE |
CONTEXT_CURRENT, CONTEXT_CURRENT_NEW, CONTEXT_NOT_CURRENT
Constructor and Description |
---|
GLContextImpl(GLContext shareWith) |
GLContextImpl(GLContext shareWith,
boolean dontShareWithJava2D) |
Modifier and Type | Method and Description |
---|---|
abstract void |
bindPbufferToTexture()
Pbuffer support; given that this is a GLContext associated with a
pbuffer, binds this pbuffer to its texture target.
|
protected GL |
createGL()
Create the GL for this context.
|
void |
destroy()
Destroys this OpenGL context and frees its associated
resources.
|
protected abstract void |
destroyImpl() |
GLBufferSizeTracker |
getBufferSizeTracker() |
GLObjectTracker |
getDeletedObjectTracker() |
int |
getFloatingPointMode()
Indicates which floating-point pbuffer implementation is in
use.
|
GL |
getGL()
Returns the GL pipeline object for this GLContext.
|
GLProcAddressTable |
getGLProcAddressTable() |
GLObjectTracker |
getObjectTracker() |
abstract int |
getOffscreenContextPixelDataType()
Only called for offscreen contexts; needed by glReadPixels
|
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.
|
abstract Object |
getPlatformGLExtensions() |
protected static String |
getThreadName() |
abstract ByteBuffer |
glAllocateMemoryNV(int arg0,
float arg1,
float arg2,
float arg3) |
boolean |
hasWaiters() |
abstract 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() |
boolean |
isSynchronized()
Returns true if 'makeCurrent' will exhibit synchronized behavior.
|
int |
makeCurrent()
Makes this GLContext current on the calling thread.
|
protected abstract int |
makeCurrentImpl() |
protected abstract String |
mapToRealGLExtensionName(String glExtensionName)
Maps the given "platform-independent" extension name to a real
function name.
|
protected abstract String |
mapToRealGLFunctionName(String glFunctionName)
Maps the given "platform-independent" function name to a real function
name.
|
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.
|
void |
release()
Releases control of this GLContext from the current thread.
|
protected abstract void |
releaseImpl() |
abstract 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.
|
protected void |
resetProcAddressTable(Object table)
Helper routine which resets a ProcAddressTable generated by the
GLEmitter by looking up anew all of its function pointers.
|
void |
setBufferSizeTracker(GLBufferSizeTracker bufferSizeTracker) |
void |
setDeletedObjectTracker(GLObjectTracker deletedObjectTracker) |
void |
setGL(GL gl)
Sets the GL pipeline object for this GLContext.
|
void |
setObjectTracker(GLObjectTracker tracker) |
void |
setSwapInterval(int interval) |
void |
setSynchronized(boolean isSynchronized)
Determines whether 'makeCurrent' will exhibit synchronized behavior.
|
static String |
toHexString(long hex) |
protected void |
update() |
copy, getCurrent, getGLDrawable, setCurrent
protected GLContextLock lock
protected static final boolean DEBUG
protected static final boolean VERBOSE
protected static final boolean NO_FREE
protected boolean optimizationEnabled
protected FunctionAvailabilityCache functionAvailability
protected GL gl
public GLContextImpl(GLContext shareWith)
public GLContextImpl(GLContext shareWith, boolean dontShareWithJava2D)
public int makeCurrent() throws GLException
GLContext
makeCurrent
in class GLContext
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.protected abstract int makeCurrentImpl() throws GLException
GLException
public void release() throws GLException
GLContext
release
in class GLContext
GLException
- if the context had not previously been made
current on the current threadprotected abstract void releaseImpl() throws GLException
GLException
public void destroy()
GLContext
protected abstract void destroyImpl() throws GLException
GLException
protected void update() throws GLException
GLException
public boolean isSynchronized()
GLContext
isSynchronized
in class GLContext
public void setSynchronized(boolean isSynchronized)
GLContext
setSynchronized
in class GLContext
public GL getGL()
GLContext
public void setGL(GL gl)
GLContext
public abstract Object getPlatformGLExtensions()
protected GL createGL()
public GLProcAddressTable getGLProcAddressTable()
public abstract void bindPbufferToTexture()
public abstract void releasePbufferFromTexture()
public abstract ByteBuffer glAllocateMemoryNV(int arg0, float arg1, float arg2, float arg3)
public void setSwapInterval(int interval)
protected abstract String mapToRealGLFunctionName(String glFunctionName)
protected abstract String mapToRealGLExtensionName(String glExtensionName)
public abstract String getPlatformExtensionsString()
protected void resetProcAddressTable(Object table)
public abstract boolean isCreated()
protected void resetGLFunctionAvailability()
isFunctionAvailable(String)
for more information on
the definition of "available".protected boolean isFunctionAvailable(String glFunctionName)
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).public boolean isExtensionAvailable(String glExtensionName)
GL.isExtensionAvailable(String)
for more details.glExtensionName
- the name of the OpenGL extension (e.g.,
"GL_VERTEX_PROGRAM_ARB").public int getFloatingPointMode() throws GLException
GLException
public abstract boolean offscreenImageNeedsVerticalFlip()
public abstract int getOffscreenContextPixelDataType()
protected static String getThreadName()
public static String toHexString(long hex)
public void setBufferSizeTracker(GLBufferSizeTracker bufferSizeTracker)
public GLBufferSizeTracker getBufferSizeTracker()
public void setObjectTracker(GLObjectTracker tracker)
public GLObjectTracker getObjectTracker()
public void setDeletedObjectTracker(GLObjectTracker deletedObjectTracker)
public GLObjectTracker getDeletedObjectTracker()
public boolean isOptimizable()
public boolean hasWaiters()
Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.