net.java.games.jogl.impl.x11

Class X11PbufferGLContext


public class X11PbufferGLContext
extends X11GLContext

Field Summary

Fields inherited from class net.java.games.jogl.impl.x11.X11GLContext

context, display, drawable, isLinuxAMD64, mostRecentDisplay, visualID

Fields inherited from class net.java.games.jogl.impl.GLContext

DEBUG, NO_FREE, VERBOSE, autoSwapBuffers, capabilities, chooser, component, deferredDestroy, deferredReshapeAction, deferredSetRealized, functionAvailability, gl, glu, gluProcAddressTable, haveResetGLUProcAddressTable, noAutoRedraw, pendingOffscreenHeight, pendingOffscreenResize, pendingOffscreenWidth, perThreadContextStack, perThreadRenderingContext, perThreadSavedCurrentContext, realized, renderingThread, willSetRenderingThread

Constructor Summary

X11PbufferGLContext(GLCapabilities capabilities, int initialWidth, int initialHeight)

Method Summary

void
bindPbufferToTexture()
Pbuffer support; given that this is a GLContext associated with a pbuffer, binds this pbuffer to its texture target.
boolean
canCreatePbufferContext()
Pbuffer support; indicates whether this context is capable of creating a subordinate pbuffer context (distinct from an "offscreen context", which is typically software-rendered on all platforms).
protected void
create()
Creates and initializes an appropriate OpenGl context.
void
createPbuffer(long display, long parentContext, GL gl)
GLContext
createPbufferContext(GLCapabilities capabilities, int initialWidth, int initialHeight)
Pbuffer support; creates a subordinate GLContext for a pbuffer associated with this context.
protected void
destroyImpl()
Destroys the underlying OpenGL context.
protected void
free()
Frees the OpenGL context.
int
getFloatingPointMode()
Indicates which floating-point pbuffer implementation is in use.
int
getOffscreenContextReadBuffer()
Only called for offscreen contexts; returns the buffer from which to read pixels (GL.GL_FRONT or GL.GL_BACK).
void
handleModeSwitch(long parentHdc, long parentHglrc)
protected boolean
isOffscreen()
Hook indicating whether the concrete GLContext implementation is offscreen and therefore whether we need to process resize requests.
protected boolean
makeCurrent(Runnable initAction)
Attempts to make the GL context current.
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
releasePbufferFromTexture()
Pbuffer support; given that this is a GLContext associated with a pbuffer, releases this pbuffer from its texture target.
void
swapBuffers()
Swaps the buffers of the OpenGL context if necessary.

Methods inherited from class net.java.games.jogl.impl.x11.X11GLContext

chooseVisual, chooseVisualAndCreateContext, create, createContext, createGL, destroyImpl, dynamicLookupFunction, free, getContext, getGLProcAddressTable, getJAWT, getOffscreenContextHeight, getOffscreenContextPixelDataType, getOffscreenContextReadBuffer, getOffscreenContextWidth, getPlatformExtensionsString, isCreated, isExtensionAvailable, isFunctionAvailable, isOffscreen, lockAWT, makeCurrent, mapToRealGLExtensionName, mapToRealGLFunctionName, offscreenImageNeedsVerticalFlip, resetGLFunctionAvailability, setRenderingThread, swapBuffers, unlockAWT

Methods inherited from class net.java.games.jogl.impl.GLContext

bindPbufferToTexture, canCreatePbufferContext, createGL, createPbufferContext, destroy, destroyImpl, dynamicLookupFunction, free, getAutoSwapBufferMode, getFloatingPointMode, getGL, getGLU, getNoAutoRedrawMode, getOffscreenContextHeight, getOffscreenContextPixelDataType, getOffscreenContextReadBuffer, getOffscreenContextWidth, getPerThreadContextStack, getPerThreadSavedCurrentContext, getPerThreadSavedInitAction, getPlatformExtensionsString, getRealized, getRenderingThread, getThreadName, invokeGL, isCreated, isExtensionAvailable, isFunctionAvailable, isOffscreen, isRealized, makeCurrent, mapToRealGLExtensionName, mapToRealGLFunctionName, offscreenImageNeedsVerticalFlip, releasePbufferFromTexture, resetGLFunctionAvailability, resetProcAddressTable, resizeOffscreenContext, setAutoSwapBufferMode, setGL, setGLU, setNoAutoRedrawMode, setPerThreadSavedCurrentContext, setRealized, setRealized, setRenderingThread, setSwapInterval, swapBuffers, willSetRenderingThread

Constructor Details

X11PbufferGLContext

public X11PbufferGLContext(GLCapabilities capabilities,
                           int initialWidth,
                           int initialHeight)

Method Details

bindPbufferToTexture

public void bindPbufferToTexture()
Pbuffer support; given that this is a GLContext associated with a pbuffer, binds this pbuffer to its texture target.
Overrides:
bindPbufferToTexture in interface GLContext

canCreatePbufferContext

public boolean canCreatePbufferContext()
Pbuffer support; indicates whether this context is capable of creating a subordinate pbuffer context (distinct from an "offscreen context", which is typically software-rendered on all platforms).
Overrides:
canCreatePbufferContext in interface GLContext

create

protected void create()
Creates and initializes an appropriate OpenGl context. Should only be called by makeCurrent(Runnable).
Overrides:
create in interface X11GLContext

createPbuffer

public void createPbuffer(long display,
                          long parentContext,
                          GL gl)

createPbufferContext

public GLContext createPbufferContext(GLCapabilities capabilities,
                                      int initialWidth,
                                      int initialHeight)
Pbuffer support; creates a subordinate GLContext for a pbuffer associated with this context.
Overrides:
createPbufferContext in interface GLContext

destroyImpl

protected void destroyImpl()
            throws GLException
Destroys the underlying OpenGL context.
Overrides:
destroyImpl in interface X11GLContext

free

protected void free()
            throws GLException
Frees the OpenGL context. All error conditions cause a GLException to be thrown.
Overrides:
free in interface X11GLContext

getFloatingPointMode

public int getFloatingPointMode()
Indicates which floating-point pbuffer implementation is in use. Returns one of GLPbuffer.APPLE_FLOAT, GLPbuffer.ATI_FLOAT, or GLPbuffer.NV_FLOAT.
Overrides:
getFloatingPointMode in interface GLContext

getOffscreenContextReadBuffer

public int getOffscreenContextReadBuffer()
Only called for offscreen contexts; returns the buffer from which to read pixels (GL.GL_FRONT or GL.GL_BACK).
Overrides:
getOffscreenContextReadBuffer in interface X11GLContext

handleModeSwitch

public void handleModeSwitch(long parentHdc,
                             long parentHglrc)

isOffscreen

protected boolean isOffscreen()
Hook indicating whether the concrete GLContext implementation is offscreen and therefore whether we need to process resize requests.
Overrides:
isOffscreen in interface X11GLContext

makeCurrent

protected boolean makeCurrent(Runnable initAction)
            throws GLException
Attempts to make the GL context current. If necessary, creates a context and calls the initAction once the context is current. Most error conditions cause an exception to be thrown, except for the case where the context can not be created because the component has not yet been visualized. In this case makeCurrent returns false and the caller should abort any OpenGL event processing and instead return immediately.
Overrides:
makeCurrent in interface X11GLContext

offscreenImageNeedsVerticalFlip

public 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.
Overrides:
offscreenImageNeedsVerticalFlip in interface X11GLContext

releasePbufferFromTexture

public void releasePbufferFromTexture()
Pbuffer support; given that this is a GLContext associated with a pbuffer, releases this pbuffer from its texture target.
Overrides:
releasePbufferFromTexture in interface GLContext

swapBuffers

public void swapBuffers()
            throws GLException
Swaps the buffers of the OpenGL context if necessary. All error conditions cause a GLException to be thrown.
Overrides:
swapBuffers in interface X11GLContext