Top Description Inners Fields Constructors Methods
jogamp.opengl

public abstract Class GLDrawableFactoryImpl

extends GLDrawableFactory
Class Inheritance
Known Direct Subclasses
jogamp.opengl.egl.EGLDrawableFactory, jogamp.opengl.macosx.cgl.MacOSXCGLDrawableFactory, jogamp.opengl.windows.wgl.WindowsWGLDrawableFactory, jogamp.opengl.x11.glx.X11GLXDrawableFactory
Imports
java.nio.Buffer, java.util.HashMap, .Iterator, .Map, .Set, com.jogamp.nativewindow.AbstractGraphicsConfiguration, .AbstractGraphicsDevice, .AbstractGraphicsScreen, .NativeSurface, .NativeWindowFactory, .OffscreenLayerSurface, .ProxySurface, .MutableSurface, .UpstreamSurfaceHook, .MutableGraphicsConfiguration, .DelegatedUpstreamSurfaceHookWithSurfaceSize, .UpstreamSurfaceHookMutableSize, com.jogamp.opengl.GLAutoDrawable, .GLCapabilities, .GLCapabilitiesChooser, .GLCapabilitiesImmutable, .GLContext, .GLDrawable, .GLDrawableFactory, .GLException, .GLFBODrawable, .GLOffscreenAutoDrawable, .GLProfile, .GLAutoDrawableDelegate, .GLRendererQuirks, com.jogamp.common.ExceptionUtils

Extends GLDrawableFactory with a few methods for handling typically software-accelerated offscreen rendering (Device Independent Bitmaps on Windows, pixmaps on X11). Direct access to these GLDrawables is not supplied directly to end users, though they may be instantiated by the GLJPanel implementation.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public class

Field Summary

Modifier and TypeField and Description
protected static final boolean
private final Map<GLDrawableFactoryImpl.DeviceScreenID, Buffer>

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public final boolean
canCreateFBO(final AbstractGraphicsDevice
which connection denotes the shared the target device, may be null for the platform's default device.
deviceReq
,
final GLProfile
GLProfile to check for FBO capabilities
glp
)

Implements abstract com.jogamp.opengl.GLDrawableFactory.canCreateFBO.

Returns true if it is possible to create an framebuffer object (FBO).
public abstract boolean
canCreateGLPbuffer(AbstractGraphicsDevice
which connection denotes the shared the target device, may be null for the platform's default device.
device
,
GLProfile
GLProfile to check for FBO capabilities
glp
)

Implements abstract com.jogamp.opengl.GLDrawableFactory.canCreateGLPbuffer.

Returns true if it is possible to create an pbuffer surface.
public final GLAutoDrawable
createDummyAutoDrawable(final AbstractGraphicsDevice
which connection denotes the shared device to be used, may be null for the platform's default device.
deviceReq
,
final boolean
if true a new independent device instance is created from the deviceReq, otherwise deviceReq is used as-is and must be valid!
createNewDevice
,
final GLCapabilitiesImmutable
the desired GLCapabilitiesImmutable, incl. it's GLProfile. For shared context, same GLCapabilitiesImmutable#getVisualID(com.jogamp.nativewindow.VisualIDHolder.VIDType) across shared drawables will yield best compatibility.
capsRequested
,
final GLCapabilitiesChooser
the custom chooser, may be null for default
chooser
)

Implements abstract com.jogamp.opengl.GLDrawableFactory.createDummyAutoDrawable.

Creates a realized dummy GLAutoDrawable incl it's dummy, invisible NativeSurface as created with createDummyDrawable(AbstractGraphicsDevice, boolean, GLCapabilitiesImmutable, GLCapabilitiesChooser).
public final GLDrawable
createDummyDrawable(final AbstractGraphicsDevice
which connection denotes the shared device to be used, may be null for the platform's default device.
deviceReq
,
final boolean
if true a new independent device instance is created from the deviceReq, otherwise deviceReq is used as-is and must be valid!
createNewDevice
,
final GLCapabilitiesImmutable
the desired GLCapabilitiesImmutable, incl. it's GLProfile. For shared context, same visual ID or caps across shared drawables will yield best compatibility.
capsRequested
,
final GLCapabilitiesChooser
the custom chooser, may be null for default
chooser
)

Implements abstract com.jogamp.opengl.GLDrawableFactory.createDummyDrawable.

Creates an unrealized dummy GLDrawable.
public final ProxySurface

Returns:

the created ProxySurface instance w/o defined surface handle but platform specific UpstreamSurfaceHook.
createDummySurface
(final AbstractGraphicsDevice
which connection denotes the shared device to be used, may be null for the platform's default device.
deviceReq
,
final GLCapabilitiesImmutable requestedCaps, final GLCapabilitiesChooser
the custom chooser, may be null for default
chooser
,
final int
the initial width as returned by NativeSurface#getSurfaceWidth(), not the actual dummy surface width. The latter is platform specific and small
width
,
final int
the initial height as returned by NativeSurface#getSurfaceHeight(), not the actual dummy surface height, The latter is platform specific and small
height
)

A dummy surface is not visible on screen, it may be on- or offscreen.

public abstract ProxySurface

Returns:

the created ProxySurface instance w/o defined surface handle but platform specific UpstreamSurfaceHook.
createDummySurfaceImpl
(AbstractGraphicsDevice
a valid platform dependent target device.
device
,
boolean
if true a new device instance is created using device details, otherwise device instance is used as-is.
createNewDevice
,
GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser
the custom chooser, may be null for default
chooser
,
int
the initial width as returned by NativeSurface#getSurfaceWidth(), not the actual dummy surface width. The latter is platform specific and small
width
,
int
the initial height as returned by NativeSurface#getSurfaceHeight(), not the actual dummy surface height, The latter is platform specific and small
height
)

A dummy surface is not visible on screen and may be on- or offscreen.

public GLContext
createExternalGLContext()

Implements abstract com.jogamp.opengl.GLDrawableFactory.createExternalGLContext.

Creates a GLContext object representing an existing OpenGL context in an external (third-party) OpenGL-based library.

protected abstract GLContext
public GLDrawable
createExternalGLDrawable()

Implements abstract com.jogamp.opengl.GLDrawableFactory.createExternalGLDrawable.

Creates a GLDrawable object representing an existing OpenGL drawable in an external (third-party) OpenGL-based library.

protected abstract GLDrawable
protected final GLFBODrawable
createFBODrawableImpl(final NativeSurface dummySurface, final GLCapabilitiesImmutable fboCaps, final int textureUnit)

Creates a platform independent unrealized FBO offscreen GLDrawable

public final GLDrawable
createGLDrawable(final NativeSurface target)

Implements abstract com.jogamp.opengl.GLDrawableFactory.createGLDrawable.

Returns an unrealized GLDrawable according to it's chosen GLCapabilitiesImmutable, which determines pixel format, on- and offscreen incl.
protected abstract ProxySurface

Returns:

the created MutableSurface instance w/o defined surface handle
createMutableSurfaceImpl
(AbstractGraphicsDevice
a valid platform dependent target device.
device
,
boolean
if true a new independent device instance is created using device details, otherwise device instance is used as-is.
createNewDevice
,
GLCapabilitiesImmutable capsChosen, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser
the custom chooser, may be null for default
chooser
,
UpstreamSurfaceHook
surface size information and optional control of the surface's lifecycle
upstreamHook
)

Creates a mutable ProxySurface w/o defined surface handle.

public final GLOffscreenAutoDrawable
createOffscreenAutoDrawable(final AbstractGraphicsDevice
which connection denotes the shared device to be used, may be null for the platform's default device.
deviceReq
,
final GLCapabilitiesImmutable
the requested GLCapabilties
capsRequested
,
final GLCapabilitiesChooser
the custom chooser, may be null for default
chooser
,
final int
the requested offscreen width
width
,
final int
the requested offscreen height
height
)

Implements abstract com.jogamp.opengl.GLDrawableFactory.createOffscreenAutoDrawable.

Creates a realized GLOffscreenAutoDrawable incl it's offscreen NativeSurface with the given capabilites and dimensions.
public final GLDrawable
createOffscreenDrawable(final AbstractGraphicsDevice
which connection denotes the shared device to be used, may be null for the platform's default device.
deviceReq
,
final GLCapabilitiesImmutable
the requested GLCapabilties
capsRequested
,
final GLCapabilitiesChooser
the custom chooser, may be null for default
chooser
,
final int
the requested offscreen width
width
,
final int
the requested offscreen height
height
)

Implements abstract com.jogamp.opengl.GLDrawableFactory.createOffscreenDrawable.

Creates an unrealized offscreen GLDrawable incl it's offscreen NativeSurface with the given capabilites and dimensions.
protected abstract GLDrawableImpl
createOffscreenDrawableImpl(NativeSurface target)

Creates a platform dependent unrealized offscreen pbuffer/pixmap GLDrawable instance

protected abstract GLDrawableImpl
public ProxySurface
createProxySurface(final AbstractGraphicsDevice
which connection denotes the shared the target device, may be null for the platform's default device. Caller has to ensure it is compatible w/ the given windowHandle
deviceReq
,
final int
matching screen index of given windowHandle
screenIdx
,
final long
the native window handle
windowHandle
,
final GLCapabilitiesImmutable
the requested GLCapabilties
capsRequested
,
final GLCapabilitiesChooser
the custom chooser, may be null for default
chooser
,
final UpstreamSurfaceHook
optional UpstreamSurfaceHook allowing control of the ProxySurface's lifecycle and data it presents.
upstream
)

Implements abstract com.jogamp.opengl.GLDrawableFactory.createProxySurface.

Creates a proxy NativeSurface w/ defined surface handle, i.e. a jogamp.nativewindow.WrappedSurface or jogamp.nativewindow.windows.GDISurface instance.
protected abstract ProxySurface
createProxySurfaceImpl(AbstractGraphicsDevice deviceReq, int screenIdx, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser, UpstreamSurfaceHook
TODO
upstream
)

Creates a ProxySurface with a set surface handle.

protected final boolean
public abstract ProxySurface

Returns:

the created ProxySurface instance w/o defined surface handle but platform specific UpstreamSurfaceHook.
createSurfacelessImpl
(AbstractGraphicsDevice
a valid platform dependent target device.
device
,
boolean
if true a new device instance is created using device details, otherwise device instance is used as-is.
createNewDevice
,
GLCapabilitiesImmutable chosenCaps, GLCapabilitiesImmutable requestedCaps, GLCapabilitiesChooser
the custom chooser, may be null for default
chooser
,
int
the initial width as returned by NativeSurface#getSurfaceWidth(), not the actual dummy surface width. The latter is platform specific and small
width
,
int
the initial height as returned by NativeSurface#getSurfaceHeight(), not the actual dummy surface height, The latter is platform specific and small
height
)

A surfaceless ProxySurface is a non-existing surface and will not be used as a render target.

private void
public static GLDrawableFactoryImpl
getFactoryImpl(final GLProfile
GLProfile to determine the factory type, ie EGLDrawableFactory, or one of the native GLDrawableFactory's, ie X11/GLX, Windows/WGL or MacOSX/CGL.
glp
)

Returns the sole GLDrawableFactoryImpl instance.

protected Buffer
getGammaRamp(final NativeSurface
TODO
surface
)

Gets the current gamma ramp.

protected int
getGammaRampLength(final NativeSurface
TODO
surface
)

Returns the length of the computed gamma ramp for this OS and hardware.

public abstract GLDynamicLookupHelper
getGLDynamicLookupHelper(final int
the major OpenGL profile version
majorVersion
,
final int
the context profile options
contextOptions
)

Returns the GLDynamicLookupHelper if installed, otherwise null.

public final GLContext
getOrCreateSharedContext(final AbstractGraphicsDevice
which connection denotes the shared the target device, may be null for the platform's default device.
device
)

Returns the shared context mapped to the device AbstractGraphicsDevice#getConnection(), either a pre-existing or newly created, or null if creation failed or not supported.

protected final AbstractGraphicsDevice
getOrCreateSharedDevice(final AbstractGraphicsDevice
which connection denotes the shared device to be used, may be null for the platform's default device.
device
)

Returns the shared device mapped to the device AbstractGraphicsDevice#getConnection(), either a preexisting or newly created, or null if creation failed or not supported.

protected final SharedResourceRunner.Resource
getOrCreateSharedResource(AbstractGraphicsDevice
which connection denotes the shared the target device, may be null for the platform's default device.
device
)

Returns the shared resource mapped to the device AbstractGraphicsDevice#getConnection(), either a pre-existing or newly created, or null if creation failed or not supported.

protected abstract SharedResourceRunner.Resource
public final GLRendererQuirks
getRendererQuirks(final AbstractGraphicsDevice
which connection denotes the shared the target device, may be null for the platform's default device.
device
,
final GLProfile
GLProfile to identify the device's GLRendererQuirks, maybe null
glp
)

Implements abstract com.jogamp.opengl.GLDrawableFactory.getRendererQuirks.

Returns the shared resource's context GLRendererQuirks.
public abstract boolean
hasMajorMinorCreateContextARB()

Method returns true if underlying ARB context creation supports major and minor version number.

protected final boolean
probeSurfacelessCtx(final GLContext
the context to probe, must be current
context
,
final boolean
If true, the initial drawable will be restored after probing and the temporary zeroDrawable will be released. If false, the temporary zeroDrawable will be kept (bound) to the context. Restoration may be skipped, if the drawable and context will be destroyed anyways.
restoreDrawable
)

Returns true if context is capable of operating without a surface, otherwise returns false and sets the GLRendererQuirks#NoSurfacelessCtx.

public final synchronized void
resetAllDisplayGamma()

Implements abstract com.jogamp.opengl.GLDrawableFactory.resetAllDisplayGamma.

Resets the gamma, brightness and contrast values of all modified displays to their original values before setDisplayGamma was called the first time.
protected final void
public final synchronized void
resetDisplayGamma(final NativeSurface surface)

Implements abstract com.jogamp.opengl.GLDrawableFactory.resetDisplayGamma.

Resets the gamma, brightness and contrast values of the display associated with the given surface to its original values before setDisplayGamma was called the first time.
protected void
resetGammaRamp(final NativeSurface
TODO
surface
,
final Buffer originalGammaRamp)

Resets the gamma ramp, potentially using the specified Buffer as data to restore the original values.

protected void
resetGammaRamp(final GLDrawableFactoryImpl.DeviceScreenID deviceScreenID, final Buffer originalGammaRamp)

public final synchronized boolean
setDisplayGamma(final NativeSurface
denominates the display device
surface
,
final float
The gamma value, typically > 1.0 (default values vary, but typically roughly 1.0)
gamma
,
final float
The brightness value between -1.0 and 1.0, inclusive (default values vary, but typically 0)
brightness
,
final float
The contrast, greater than 0.0 (default values vary, but typically 1)
contrast
)

Implements abstract com.jogamp.opengl.GLDrawableFactory.setDisplayGamma.

Sets the gamma, brightness, and contrast of the display associated with the given surface.
protected boolean
setGammaRamp(final NativeSurface
TODO
surface
,
final float[] ramp)

Sets the gamma ramp for the main screen.

protected final void
setNoSurfacelessCtxQuirk(final GLContext
the context to probe, must be current
context
)

Method will set the GLRendererQuirks#NoSurfacelessCtx if it has not been set already.

private final void
Inherited from com.jogamp.opengl.GLDrawableFactory:
canCreateExternalGLDrawablecreateSharedResourceenterThreadCriticalZonegetAvailableCapabilitiesgetAvailableCapabilitiesImplgetDefaultDevicegetDesktopFactorygetEGLFactorygetFactorygetFactoryImplgetFactoryImplgetIsDeviceCompatiblegetSharedResourceThreadgetThreadNamehasOpenGLDesktopSupporthasOpenGLESSupporthasRendererQuirkinitSingletonisCompleteleaveThreadCriticalZoneshutdownshutdownImplvalidateDevice