JOGL v2.6.0-rc-20250706
JOGL, High-Performance Graphics Binding for Java™ (public API).
com.jogamp.opengl.GLContext Class Referenceabstract

Abstraction for an OpenGL rendering context. More...

Collaboration diagram for com.jogamp.opengl.GLContext:

Public Member Functions

final boolean isShared ()
 Returns true if this GLContext is shared, otherwise false. More...
 
final GLContext getSharedMaster ()
 Returns the shared master GLContext of this GLContext if shared, otherwise return null. More...
 
final List< GLContextgetCreatedShares ()
 Returns a new list of created GLContext shared with this GLContext. More...
 
final List< GLContextgetDestroyedShares ()
 Returns a new list of destroyed GLContext shared with this GLContext. More...
 
final GLRendererQuirks getRendererQuirks ()
 Returns the instance of GLRendererQuirks, allowing one to determine workarounds. More...
 
final boolean hasRendererQuirk (final int quirk) throws IllegalArgumentException
 Returns true if the quirk exist in getRendererQuirks(), otherwise false. More...
 
abstract GLDrawable setGLDrawable (GLDrawable readWrite, boolean setWriteOnly)
 Sets the read/write drawable for framebuffer operations, i.e. More...
 
abstract GLDrawable getGLDrawable ()
 Returns the write-drawable this context uses for framebuffer operations. More...
 
abstract boolean isGLReadDrawableAvailable ()
 Query whether using a distinguished read-drawable is supported. More...
 
abstract GLDrawable setGLReadDrawable (GLDrawable read)
 Set the read-Drawable for read framebuffer operations. More...
 
abstract GLDrawable getGLReadDrawable ()
 Returns the read-Drawable this context uses for read framebuffer operations. More...
 
abstract int makeCurrent () throws GLException
 Makes this GLContext current on the calling thread. More...
 
abstract void release () throws GLException
 Releases control of this GLContext from the current thread. More...
 
abstract void copy (GLContext source, int mask) throws GLException
 Copies selected groups of OpenGL state variables from the supplied source context into this one. More...
 
final boolean isCurrent ()
 
final void validateCurrent () throws GLException
 
abstract void destroy ()
 Destroys this OpenGL context and frees its associated resources. More...
 
abstract GL getRootGL ()
 Returns the implementing root GL instance of this GLContext's GL object, considering a wrapped pipelined hierarchy, see GLBase#getDownstreamGL(). More...
 
abstract GL getGL ()
 Returns the GL pipeline object for this GLContext. More...
 
abstract GL setGL (GL gl)
 Sets the GL pipeline object for this GLContext. More...
 
final long getHandle ()
 Returns the underlying native OpenGL context handle. More...
 
final boolean isCreated ()
 Indicates whether the underlying native OpenGL context has been created. More...
 
final Object getAttachedObject (final String name)
 Returns the attached user object for the given name to this GLContext. More...
 
final Object attachObject (final String name, final Object obj)
 Sets the attached user object for the given name to this GLContext. More...
 
final Object detachObject (final String name)
 
String toString ()
 Classname, GL, GLDrawable. More...
 
final StringBuilder append (final StringBuilder sb)
 
abstract 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. More...
 
abstract 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. More...
 
abstract int getPlatformExtensionCount ()
 Returns the number of platform extensions. More...
 
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. More...
 
abstract int getGLExtensionCount ()
 Returns the number of OpenGL extensions. More...
 
abstract String getGLExtensionsString ()
 Returns a non-null (but possibly empty) string containing the space-separated list of available extensions. More...
 
abstract int getContextCreationFlags ()
 
abstract void setContextCreationFlags (int flags)
 
final String getGLVersion ()
 Returns a valid OpenGL version string, ie
More...
 
final VersionNumber getGLVersionNumber ()
 Returns this context OpenGL version. More...
 
final VersionNumberString getGLVendorVersionNumber ()
 Returns the vendor's version, i.e. More...
 
final boolean isGLCompatibilityProfile ()
 
final boolean isGLCoreProfile ()
 
final boolean isGLESProfile ()
 
final boolean isGLForwardCompatible ()
 
final boolean isGLDebugEnabled ()
 
final boolean isCreatedWithARBMethod ()
 
final String getGLSLVersionString ()
 Returns the matching GLSL version number, queried by this context GL via GL2ES2#GL_SHADING_LANGUAGE_VERSION if ≥ ES2.0 or GL2.0, otherwise a static match is being utilized. More...
 
final boolean isGLES2Compatible ()
 
final boolean isGLES3Compatible ()
 Return true if this context is an ES3 context or implements the extension GL_ARB_ES3_compatibility, otherwise false. More...
 
final boolean isGLES31Compatible ()
 Return true if this context is an ES3 context ≥ 3.1 or implements the extension GL_ARB_ES3_1_compatibility, otherwise false. More...
 
final boolean isGLES32Compatible ()
 Return true if this context is an ES3 context ≥ 3.2 or implements the extension GL_ARB_ES3_2_compatibility, otherwise false. More...
 
final boolean isHardwareRasterizer ()
 
final boolean hasGLSL ()
 
final boolean hasBasicFBOSupport ()
 Returns true if basic FBO support is available, otherwise false. More...
 
final boolean hasFullFBOSupport ()
 Returns true if full FBO support is available, otherwise false. More...
 
final boolean hasFP32CompatAPI ()
 Returns true if OES_single_precision, fp32, fixed function point (FFP) compatibility entry points available, otherwise false. More...
 
final int getMaxRenderbufferSamples ()
 Returns the maximum number of FBO RENDERBUFFER samples if full FBO is supported, otherwise false. More...
 
boolean isNPOTTextureAvailable ()
 Note: The GL impl. More...
 
boolean isTextureFormatBGRA8888Available ()
 
final boolean isGL4bc ()
 Indicates whether this GLContext is capable of GL4bc. More...
 
final boolean isGL4 ()
 Indicates whether this GLContext is capable of GL4. More...
 
final boolean isGL4core ()
 Indicates whether this GLContext uses a GL4 core profile. More...
 
final boolean isGL3bc ()
 Indicates whether this GLContext is capable of GL3bc. More...
 
final boolean isGL3 ()
 Indicates whether this GLContext is capable of GL3. More...
 
final boolean isGL3core ()
 Indicates whether this GLContext uses a GL3 core profile. More...
 
final boolean isGLcore ()
 Indicates whether this GLContext uses a GL core profile. More...
 
final boolean isCPUDataSourcingAvail ()
 Indicates whether this GLContext allows CPU data sourcing (indices, vertices ..) as opposed to using a GPU buffer source (VBO), e.g. More...
 
final boolean hasNoDefaultVAO ()
 Indicates whether this GLContext's native profile does not implement a default vertex array object (VAO), starting w/ OpenGL 3.1 core. More...
 
abstract int getDefaultVAO ()
 If this GLContext does not implement a default VAO, see hasNoDefaultVAO(), an own default VAO will be created and bound at context creation. More...
 
final boolean isGL2 ()
 Indicates whether this GLContext is capable of GL2. More...
 
final boolean isGL2GL3 ()
 Indicates whether this GLContext is capable of GL2GL3. More...
 
final boolean isGLES1 ()
 Indicates whether this GLContext is capable of GLES1. More...
 
final boolean isGLES2 ()
 Indicates whether this GLContext is capable of GLES2. More...
 
final boolean isGLES3 ()
 Indicates whether this GLContext is capable of GLES3. More...
 
final boolean isGLES ()
 Indicates whether this GLContext is capable of GLES. More...
 
final boolean isGL2ES1 ()
 Indicates whether this GLContext is capable of GL2ES1. More...
 
final boolean isGL2ES2 ()
 Indicates whether this GLContext is capable of GL2ES2. More...
 
final boolean isGL2ES3 ()
 Indicates whether this GLContext is capable of GL2ES3. More...
 
final boolean isGL3ES3 ()
 Indicates whether this GLContext is capable of GL3ES3. More...
 
final boolean isGL4ES3 ()
 Returns true if this profile is capable of GL4ES3, i.e. More...
 
boolean setSwapInterval (final int interval) throws GLException
 Set the swap interval of the current context and attached onscreen GLDrawable. More...
 
int getSwapInterval ()
 Return the current swap interval. More...
 
final boolean queryMaxSwapGroups (final int[] maxGroups, final int maxGroups_offset, final int[] maxBarriers, final int maxBarriers_offset)
 
final boolean joinSwapGroup (final int group)
 
int getSwapGroup ()
 
final boolean bindSwapBarrier (final int group, final int barrier)
 
abstract int getBoundFramebuffer (int target)
 Return the framebuffer name bound to this context, see GL#glBindFramebuffer(int, int). More...
 
abstract int getDefaultDrawFramebuffer ()
 Return the default draw framebuffer name. More...
 
abstract int getDefaultReadFramebuffer ()
 Return the default read framebuffer name. More...
 
abstract int getDefaultDrawBuffer ()
 Returns the default color buffer within the current bound getDefaultReadFramebuffer(), i.e. More...
 
abstract int getDefaultReadBuffer ()
 Returns the default color buffer within the current bound getDefaultReadFramebuffer(), i.e. More...
 
abstract int getDefaultPixelDataType ()
 Get the default pixel data type, as required by e.g. More...
 
abstract int getDefaultPixelDataFormat ()
 Get the default pixel data format, as required by e.g. More...
 
abstract DynamicLibraryBundle getDynamicLibraryBundle ()
 Returns the DynamicLibraryBundle, matching context. More...
 
abstract String getGLDebugMessageExtension ()
 
abstract boolean isGLDebugSynchronous ()
 
abstract void setGLDebugSynchronous (boolean synchronous)
 Enables or disables the synchronous debug behavior via glEnable/glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS), if extension is GLExtensions#ARB_debug_output. More...
 
abstract boolean isGLDebugMessageEnabled ()
 
abstract void enableGLDebugMessage (boolean enable) throws GLException
 Enables or disables the GLDebugOutput feature of extension GLExtensions#ARB_debug_output or GLExtensions#AMD_debug_output, if available. More...
 
abstract void addGLDebugListener (GLDebugListener listener)
 Add GLDebugListener. More...
 
abstract void removeGLDebugListener (GLDebugListener listener)
 Remove GLDebugListener. More...
 
abstract void glDebugMessageControl (int source, int type, int severity, int count, IntBuffer ids, boolean enabled)
 Generic entry for GL2GL3#glDebugMessageControl(int, int, int, int, IntBuffer, boolean) and GL2GL3#glDebugMessageEnableAMD(int, int, int, IntBuffer, boolean) of the GLDebugOutput feature. More...
 
abstract void glDebugMessageControl (int source, int type, int severity, int count, int[] ids, int ids_offset, boolean enabled)
 Generic entry for GL2GL3#glDebugMessageControl(int, int, int, int, int[], int, boolean) and GL2GL3#glDebugMessageEnableAMD(int, int, int, int[], int, boolean) of the GLDebugOutput feature. More...
 
abstract void glDebugMessageInsert (int source, int type, int id, int severity, String buf)
 Generic entry for GL2GL3#glDebugMessageInsert(int, int, int, int, int, String) and GL2GL3#glDebugMessageInsertAMD(int, int, int, int, String) of the GLDebugOutput feature. More...
 

Static Public Member Functions

static GL getCurrentGL () throws GLException
 Returns the GL object bound to this thread current context. More...
 
static GLContext getCurrent ()
 Returns this thread current context. More...
 
static final String makeCurrentResultToString (final int res)
 Returns a String representation of the makeCurrent() result. More...
 
static final int getMaxMajor (final int ctxProfile)
 
static final int getMaxMinor (final int ctxProfile, final int major)
 
static final boolean isValidGLVersion (final int ctxProfile, final int major, final int minor)
 Returns true, if the major.minor is not inferior to the lowest valid version and does not exceed the highest known major number by more than one. More...
 
static final boolean clipGLVersion (final int ctxProfile, final int major[], final int minor[])
 Clip the given GL version to the maximum known valid version if exceeding. More...
 
static final boolean decrementGLVersion (final int ctxProfile, final int major[], final int minor[])
 Decrement the given GL version by one and return true if still valid, otherwise false. More...
 
static final boolean isFBOAvailable (final AbstractGraphicsDevice device, final GLProfile glp)
 Returns true if it is possible to create an framebuffer object (FBO). More...
 
static final int isHardwareRasterizer (final AbstractGraphicsDevice device, final GLProfile glp)
 
static boolean isGLES1Available (final AbstractGraphicsDevice device, final boolean isHardware[])
 
static boolean isGLES2Available (final AbstractGraphicsDevice device, final boolean isHardware[])
 
static boolean isGLES3Available (final AbstractGraphicsDevice device, final boolean isHardware[])
 
static final boolean isGLES3CompatibleAvailable (final AbstractGraphicsDevice device)
 Returns true if a ES3 compatible profile is available, i.e. More...
 
static final boolean isGLES31CompatibleAvailable (final AbstractGraphicsDevice device)
 Returns true if a ES3 ≥ 3.1 compatible profile is available, i.e. More...
 
static final boolean isGLES32CompatibleAvailable (final AbstractGraphicsDevice device)
 Returns true if a ES3 ≥ 3.2 compatible profile is available, i.e. More...
 
static boolean isGL4bcAvailable (final AbstractGraphicsDevice device, final boolean isHardware[])
 
static boolean isGL4Available (final AbstractGraphicsDevice device, final boolean isHardware[])
 
static boolean isGL3bcAvailable (final AbstractGraphicsDevice device, final boolean isHardware[])
 
static boolean isGL3Available (final AbstractGraphicsDevice device, final boolean isHardware[])
 
static boolean isGL2Available (final AbstractGraphicsDevice device, final boolean isHardware[])
 

Static Public Attributes

static final boolean DEBUG = Debug.debug("GLContext")
 
static final boolean TRACE_SWITCH = Debug.isPropertyDefined("jogl.debug.GLContext.TraceSwitch", true)
 
static final boolean DEBUG_TRACE_SWITCH = DEBUG || TRACE_SWITCH
 
static final boolean PROFILE_ALIASING = !Debug.isPropertyDefined("jogl.debug.GLContext.NoProfileAliasing", true)
 If true (default), bootstrapping the available GL profiles will use the highest compatible GL context for each profile, hence skipping querying lower profiles if a compatible higher one is found: More...
 
static final boolean DEBUG_GL = Debug.isPropertyDefined("jogl.debug.DebugGL", true)
 Reflects property jogl.debug.DebugGL. More...
 
static final boolean TRACE_GL = Debug.isPropertyDefined("jogl.debug.TraceGL", true)
 Reflects property jogl.debug.TraceGL. More...
 
static final int CONTEXT_NOT_CURRENT = 0
 Indicates that the context was not made current during the last call to makeCurrent, value {@value}. More...
 
static final int CONTEXT_CURRENT = 1
 Indicates that the context was made current during the last call to makeCurrent, value {@value}. More...
 
static final int CONTEXT_CURRENT_NEW = 2
 Indicates that a newly-created context was made current during the last call to makeCurrent, value {@value}. More...
 
static final VersionNumber Version1_0 = new VersionNumber(1, 0, 0)
 Version 1.00, i.e. More...
 
static final VersionNumber Version1_10 = new VersionNumber(1, 10, 0)
 Version 1.10, i.e. More...
 
static final VersionNumber Version1_20 = new VersionNumber(1, 20, 0)
 Version 1.20, i.e. More...
 
static final VersionNumber Version1_30 = new VersionNumber(1, 30, 0)
 Version 1.30, i.e. More...
 
static final VersionNumber Version1_40 = new VersionNumber(1, 40, 0)
 Version 1.40, i.e. More...
 
static final VersionNumber Version1_50 = new VersionNumber(1, 50, 0)
 Version 1.50, i.e. More...
 
static final VersionNumber Version1_1 = new VersionNumber(1, 1, 0)
 Version 1.1, i.e. More...
 
static final VersionNumber Version1_2 = new VersionNumber(1, 2, 0)
 Version 1.2, i.e. More...
 
static final VersionNumber Version1_4 = new VersionNumber(1, 4, 0)
 Version 1.4, i.e. More...
 
static final VersionNumber Version1_5 = new VersionNumber(1, 5, 0)
 Version 1.5, i.e. More...
 
static final VersionNumber Version3_0 = new VersionNumber(3, 0, 0)
 Version 3.0. More...
 
static final VersionNumber Version3_1 = new VersionNumber(3, 1, 0)
 Version 3.1. More...
 
static final VersionNumber Version3_2 = new VersionNumber(3, 2, 0)
 Version 3.2. More...
 
static final VersionNumber Version4_3 = new VersionNumber(4, 3, 0)
 Version 4.3. More...
 
static final int CTX_OPTION_DEBUG = 1 << 5
 ARB_create_context related: flag debug. More...
 
static final int GL_VERSIONS [][]
 
static final int ES_VERSIONS [][]
 

Protected Member Functions

 GLContext ()
 
void resetStates (final boolean isInit)
 
boolean setSwapIntervalImpl (final int interval)
 
void setDefaultSwapInterval ()
 
boolean queryMaxSwapGroupsImpl (final int[] maxGroups, final int maxGroups_offset, final int[] maxBarriers, final int maxBarriers_offset)
 
boolean joinSwapGroupImpl (final int group)
 
boolean bindSwapBarrierImpl (final int group, final int barrier)
 

Static Protected Member Functions

static void setCurrent (final GLContext cur)
 Sets the thread-local variable returned by getCurrent and has no other side-effects. More...
 
static final VersionNumber getStaticGLSLVersionNumber (final int glMajorVersion, final int glMinorVersion, final int ctxOptions)
 
static int composeBits (final int a8, final int b8, final int c16)
 
static VersionNumber decomposeBits (final int bits32, final int[] ctp)
 
static int getCTPFromBits (final int bits32)
 
static void validateProfileBits (final int bits, final String argName)
 
static void shutdown ()
 clears the device/context mappings as well as the GL/GLX proc address tables. More...
 
static boolean getAvailableGLVersionsSet (final AbstractGraphicsDevice device)
 
static void setAvailableGLVersionsSet (final AbstractGraphicsDevice device, final boolean set)
 
static String getDeviceVersionAvailableKey (final AbstractGraphicsDevice device, final int major, final int profile)
 Returns a unique String object using String#intern() for the given arguments, which object reference itself can be used as a key. More...
 
static StringBuilder dumpAvailableGLVersions (StringBuilder sb)
 
static Integer getAvailableGLVersion (final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile)
 
static boolean getAvailableGLVersion (final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile, final int[] major, final int minor[], final int ctp[])
 
static String getGLProfile (final int major, final int minor, final int ctp) throws GLException
 returns the highest GLProfile string regarding the implementation version and context profile bits. More...
 
static final void getRequestMajorAndCompat (final GLProfile glp, final int[] reqMajorCTP)
 Returns the GLProfile's major version number at reqMajorCTP[0] and it's context property (CTP) at reqMajorCTP[1] for availability mapping request. More...
 
static final int getAvailableContextProperties (final AbstractGraphicsDevice device, final GLProfile glp)
 
static GLProfile getAvailableGLProfile (final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile) throws GLException
 
static String getAvailableGLVersionAsString (final AbstractGraphicsDevice device, final int major, final int profile)
 
static boolean isGLVersionAvailable (final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile, final boolean isHardware[])
 
static StringBuilder getGLProfile (final StringBuilder sb, final int ctp)
 
static StringBuilder getGLVersion (final StringBuilder sb, final VersionNumber version, final int ctp, final String gl_version)
 
static StringBuilder getGLVersion (final StringBuilder sb, final int major, final int minor, final int ctp, final String gl_version)
 
static String getGLVersion (final int major, final int minor, final int ctp, final String gl_version)
 
static String toHexString (final int hex)
 
static String toHexString (final long hex)
 
static String getThreadName ()
 

Protected Attributes

final RecursiveLock lock = LockFactory.createRecursiveLock()
 
volatile long contextHandle
 The underlying native OpenGL context. More...
 
VersionNumber ctxVersion
 
int ctxOptions
 
String ctxVersionString
 
VersionNumberString ctxVendorVersion
 
VersionNumber ctxGLSLVersion
 
GLRendererQuirks glRendererQuirks
 
boolean drawableRetargeted
 Did the drawable association changed ? see GLRendererQuirks#NoSetSwapIntervalPostRetarget. More...
 
int currentSwapGroup = -1
 

Static Protected Attributes

static final VersionNumber Version8_0 = new VersionNumber(8, 0, 0)
 
static final int CTX_IMPL_FULL_MASK = 0x0000FFFF
 Context option bits, full bit mask covering 16 bits [0..15], i.e. More...
 
static final int CTX_IMPL_CACHE_MASK = 0x000003FF
 Context option bits, cached bit mask covering 10 bits [0..9], i.e. More...
 
static final int CTX_IS_ARB_CREATED = 1 << 0
 ARB_create_context related: created via ARB_create_context. More...
 
static final int CTX_PROFILE_COMPAT = 1 << 1
 ARB_create_context related: desktop compatibility profile. More...
 
static final int CTX_PROFILE_CORE = 1 << 2
 ARB_create_context related: desktop core profile. More...
 
static final int CTX_PROFILE_ES = 1 << 3
 ARB_create_context related: ES profile. More...
 
static final int CTX_OPTION_FORWARD = 1 << 4
 ARB_create_context related: flag forward compatible. More...
 
static final int CTX_IMPL_ACCEL_SOFT = 1 << 6
 Context uses software rasterizer, otherwise hardware rasterizer. More...
 
static final int CTX_IMPL_ES2_COMPAT = 1 << 10
 GL_ARB_ES2_compatibility implementation related: Context is compatible w/ ES2. More...
 
static final int CTX_IMPL_ES3_COMPAT = 1 << 11
 GL_ARB_ES3_compatibility implementation related: Context is compatible w/ ES3. More...
 
static final int CTX_IMPL_ES31_COMPAT = 1 << 12
 GL_ARB_ES3_1_compatibility implementation related: Context is compatible w/ ES 3.1. More...
 
static final int CTX_IMPL_ES32_COMPAT = 1 << 13
 GL_ARB_ES3_2_compatibility implementation related: Context is compatible w/ ES 3.2. More...
 
static final int CTX_IMPL_FBO = 1 << 14
 Context supports basic FBO, details see hasBasicFBOSupport(). More...
 
static final int CTX_IMPL_FP32_COMPAT_API = 1 << 15
 Context supports OES_single_precision, fp32, fixed function point (FFP) compatibility entry points, see hasFP32CompatAPI(). More...
 
static final IdentityHashMap< String, Integer > deviceVersionAvailable = new IdentityHashMap<String, Integer>()
 

Detailed Description

Abstraction for an OpenGL rendering context.

In order to perform OpenGL rendering, a context must be "made current" on the current thread. OpenGL rendering semantics specify that only one context may be current on the current thread at any given time, and also that a given context may be current on only one thread at any given time. Because components can be added to and removed from the component hierarchy at any time, it is possible that the underlying OpenGL context may need to be destroyed and recreated multiple times over the lifetime of a given component. This process is handled by the implementation, and the GLContext abstraction provides a stable object which clients can use to refer to a given context.

Definition at line 74 of file GLContext.java.

Constructor & Destructor Documentation

◆ GLContext()

com.jogamp.opengl.GLContext.GLContext ( )
protected

Definition at line 227 of file GLContext.java.

Here is the call graph for this function:

Member Function Documentation

◆ addGLDebugListener()

abstract void com.jogamp.opengl.GLContext.addGLDebugListener ( GLDebugListener  listener)
abstract

◆ append()

final StringBuilder com.jogamp.opengl.GLContext.append ( final StringBuilder  sb)

Definition at line 640 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ attachObject()

final Object com.jogamp.opengl.GLContext.attachObject ( final String  name,
final Object  obj 
)

Sets the attached user object for the given name to this GLContext.

Returns the previously set object or null.

Definition at line 619 of file GLContext.java.

Here is the caller graph for this function:

◆ bindSwapBarrier()

final boolean com.jogamp.opengl.GLContext.bindSwapBarrier ( final int  group,
final int  barrier 
)

Definition at line 1322 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ bindSwapBarrierImpl()

boolean com.jogamp.opengl.GLContext.bindSwapBarrierImpl ( final int  group,
final int  barrier 
)
protected

Definition at line 1326 of file GLContext.java.

Here is the caller graph for this function:

◆ clipGLVersion()

static final boolean com.jogamp.opengl.GLContext.clipGLVersion ( final int  ctxProfile,
final int  major[],
final int  minor[] 
)
static

Clip the given GL version to the maximum known valid version if exceeding.

Returns
true if clipped, i.e. given value exceeds maximum, otherwise false.

Definition at line 1597 of file GLContext.java.

Here is the caller graph for this function:

◆ composeBits()

static int com.jogamp.opengl.GLContext.composeBits ( final int  a8,
final int  b8,
final int  c16 
)
staticprotected

Definition at line 1662 of file GLContext.java.

Here is the caller graph for this function:

◆ copy()

abstract void com.jogamp.opengl.GLContext.copy ( GLContext  source,
int  mask 
) throws GLException
abstract

Copies selected groups of OpenGL state variables from the supplied source context into this one.

The 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.

Parameters
sourcethe source OpenGL context from which to copy state
maska mask of symbolic names indicating which groups of state to copy
Exceptions
GLExceptionif an OpenGL-related error occurred

◆ decomposeBits()

static VersionNumber com.jogamp.opengl.GLContext.decomposeBits ( final int  bits32,
final int[]  ctp 
)
staticprotected

Definition at line 1667 of file GLContext.java.

Here is the caller graph for this function:

◆ decrementGLVersion()

static final boolean com.jogamp.opengl.GLContext.decrementGLVersion ( final int  ctxProfile,
final int  major[],
final int  minor[] 
)
static

Decrement the given GL version by one and return true if still valid, otherwise false.

If the given version exceeds the maximum known valid version, it is clipped and true is returned.

Parameters
ctxProfile
major
minor
Returns

Definition at line 1636 of file GLContext.java.

Here is the call graph for this function:

◆ destroy()

abstract void com.jogamp.opengl.GLContext.destroy ( )
abstract

Destroys this OpenGL context and frees its associated resources.

The context may be current w/o recursion when calling destroy(), in which case this method destroys the context and releases the lock.

Here is the caller graph for this function:

◆ detachObject()

final Object com.jogamp.opengl.GLContext.detachObject ( final String  name)

Definition at line 623 of file GLContext.java.

Here is the caller graph for this function:

◆ dumpAvailableGLVersions()

static StringBuilder com.jogamp.opengl.GLContext.dumpAvailableGLVersions ( StringBuilder  sb)
staticprotected

Definition at line 1738 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ enableGLDebugMessage()

abstract void com.jogamp.opengl.GLContext.enableGLDebugMessage ( boolean  enable) throws GLException
abstract

Enables or disables the GLDebugOutput feature of extension GLExtensions#ARB_debug_output or GLExtensions#AMD_debug_output, if available.

To enable the GLDebugOutput feature enableGLDebugMessage(true) or setContextCreationFlags(GLContext#CTX_OPTION_DEBUG) shall be called before context creation via makeCurrent()!

In case GLAutoDrawable are being used, glAutoDrawable.setContextCreationFlags(GLContext#CTX_OPTION_DEBUG) shall be issued before context creation via makeCurrent()!

After context creation, the GLDebugOutput feature may be enabled or disabled at any time using this method.

Parameters
enableIf true enables, otherwise disables the GLDebugOutput feature.
Exceptions
GLExceptionif this context is not current or GLDebugOutput registration failed (enable)
See also
setContextCreationFlags(int)
addGLDebugListener(GLDebugListener)
GLAutoDrawable::setContextCreationFlags(int)
Here is the caller graph for this function:

◆ getAttachedObject()

final Object com.jogamp.opengl.GLContext.getAttachedObject ( final String  name)

Returns the attached user object for the given name to this GLContext.

Definition at line 611 of file GLContext.java.

Here is the caller graph for this function:

◆ getAvailableContextProperties()

static final int com.jogamp.opengl.GLContext.getAvailableContextProperties ( final AbstractGraphicsDevice  device,
final GLProfile  glp 
)
staticprotected
Parameters
devicethe device the context profile is being requested for
GLProfilethe GLProfile the context profile is being requested for
Returns
the GLProfile's context property (CTP) if available, otherwise 0

Definition at line 1858 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAvailableGLProfile()

static GLProfile com.jogamp.opengl.GLContext.getAvailableGLProfile ( final AbstractGraphicsDevice  device,
final int  reqMajor,
final int  reqProfile 
) throws GLException
staticprotected
Parameters
devicethe device the profile is being requested
majorKey Value either 1, 2, 3 or 4
profileKey Value either CTX_PROFILE_COMPAT, CTX_PROFILE_CORE or CTX_PROFILE_ES
Returns
the highest GLProfile for the device regarding availability, version and profile bits.

Definition at line 1877 of file GLContext.java.

Here is the call graph for this function:

◆ getAvailableGLVersion() [1/2]

static Integer com.jogamp.opengl.GLContext.getAvailableGLVersion ( final AbstractGraphicsDevice  device,
final int  reqMajor,
final int  reqProfile 
)
staticprotected
Parameters
devicethe device to request whether the profile is available for
reqMajorKey Value either 1, 2, 3 or 4
reqProfileKey Value either CTX_PROFILE_COMPAT, CTX_PROFILE_CORE or CTX_PROFILE_ES
Returns
the available GL version as encoded with , otherwise null

Definition at line 1771 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAvailableGLVersion() [2/2]

static boolean com.jogamp.opengl.GLContext.getAvailableGLVersion ( final AbstractGraphicsDevice  device,
final int  reqMajor,
final int  reqProfile,
final int[]  major,
final int  minor[],
final int  ctp[] 
)
staticprotected
Parameters
reqMajorKey Value either 1, 2, 3 or 4
reqProfileKey Value either CTX_PROFILE_COMPAT, CTX_PROFILE_CORE or CTX_PROFILE_ES
majorif not null, returns the used major version
minorif not null, returns the used minor version
ctpif not null, returns the used context profile

Definition at line 1787 of file GLContext.java.

Here is the call graph for this function:

◆ getAvailableGLVersionAsString()

static String com.jogamp.opengl.GLContext.getAvailableGLVersionAsString ( final AbstractGraphicsDevice  device,
final int  major,
final int  profile 
)
staticprotected
Parameters
devicethe device the profile is being requested
majorKey Value either 1, 2, 3 or 4
profileKey Value either CTX_PROFILE_COMPAT, CTX_PROFILE_CORE or CTX_PROFILE_ES

Definition at line 1905 of file GLContext.java.

Here is the call graph for this function:

◆ getAvailableGLVersionsSet()

static boolean com.jogamp.opengl.GLContext.getAvailableGLVersionsSet ( final AbstractGraphicsDevice  device)
staticprotected

Definition at line 1708 of file GLContext.java.

Here is the call graph for this function:

◆ getBoundFramebuffer()

abstract int com.jogamp.opengl.GLContext.getBoundFramebuffer ( int  target)
abstract

Return the framebuffer name bound to this context, see GL#glBindFramebuffer(int, int).

Method is only thread-safe while context is made current.

◆ getContextCreationFlags()

abstract int com.jogamp.opengl.GLContext.getContextCreationFlags ( )
abstract
Returns
Additional context creation flags, supported: GLContext#CTX_OPTION_DEBUG.

◆ getCreatedShares()

final List< GLContext > com.jogamp.opengl.GLContext.getCreatedShares ( )

Returns a new list of created GLContext shared with this GLContext.

Definition at line 277 of file GLContext.java.

Here is the caller graph for this function:

◆ getCTPFromBits()

static int com.jogamp.opengl.GLContext.getCTPFromBits ( final int  bits32)
staticprotected

Definition at line 1673 of file GLContext.java.

◆ getCurrent()

static GLContext com.jogamp.opengl.GLContext.getCurrent ( )
static

Returns this thread current context.

If no context is current, returns null.

Returns
the context current on this thread, or null if no context is current.

Definition at line 515 of file GLContext.java.

Here is the caller graph for this function:

◆ getCurrentGL()

static GL com.jogamp.opengl.GLContext.getCurrentGL ( ) throws GLException
static

Returns the GL object bound to this thread current context.

If no context is current, throw an GLException

Returns
the current context's GL object on this thread
Exceptions
GLExceptionif no context is current

Definition at line 500 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDefaultDrawBuffer()

abstract int com.jogamp.opengl.GLContext.getDefaultDrawBuffer ( )
abstract

Returns the default color buffer within the current bound getDefaultReadFramebuffer(), i.e.

GL_READ_FRAMEBUFFER​, which will be used as the target (output) for (fragment shader) draw commands, settable via GL2ES2#glDrawBuffers(int, int[], int) or GL2#glDrawBuffer(int).

For offscreen framebuffer objects this is GL#GL_COLOR_ATTACHMENT0, otherwise this is GL#GL_FRONT for non-ES profile and single buffer configurations and GL#GL_BACK for double buffer configurations or ES profiles.

Note-1: Neither ES1 nor ES2 supports selecting the draw buffer at all and GL#GL_BACK is the default.

Note-2: ES3 only supports GL#GL_BACK, GL#GL_NONE or GL#GL_COLOR_ATTACHMENT0+i via GL2ES2#glDrawBuffers(int, int[], int).

Method is only thread-safe while context is made current.

◆ getDefaultDrawFramebuffer()

abstract int com.jogamp.opengl.GLContext.getDefaultDrawFramebuffer ( )
abstract

Return the default draw framebuffer name.

May differ from it's default zero in case an framebuffer object (com.jogamp.opengl.FBObject) based drawable is being used.

Method is only thread-safe while context is made current.

◆ getDefaultPixelDataFormat()

abstract int com.jogamp.opengl.GLContext.getDefaultPixelDataFormat ( )
abstract

Get the default pixel data format, as required by e.g.

GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer).

Method is only thread-safe while context is made current.

Here is the caller graph for this function:

◆ getDefaultPixelDataType()

abstract int com.jogamp.opengl.GLContext.getDefaultPixelDataType ( )
abstract

Get the default pixel data type, as required by e.g.

GL#glReadPixels(int, int, int, int, int, int, java.nio.Buffer).

Method is only thread-safe while context is made current.

Here is the caller graph for this function:

◆ getDefaultReadBuffer()

abstract int com.jogamp.opengl.GLContext.getDefaultReadBuffer ( )
abstract

Returns the default color buffer within the current bound getDefaultReadFramebuffer(), i.e.

GL_READ_FRAMEBUFFER​, which will be used as the source for pixel reading commands, like glReadPixels etc.

For offscreen framebuffer objects this is GL#GL_COLOR_ATTACHMENT0, otherwise this is GL#GL_FRONT for non-ES profile and single buffer configurations and GL#GL_BACK for double buffer configurations or ES profiles.

Note-1: Neither ES1 nor ES2 supports selecting the read buffer via glReadBuffer and GL#GL_BACK is the default.

Note-2: ES3 only supports GL#GL_BACK, GL#GL_NONE or GL#GL_COLOR_ATTACHMENT0+i

Note-3: See swapBuffersBeforeRead for read-pixels and swap-buffers implications.

Method is only thread-safe while context is made current.

◆ getDefaultReadFramebuffer()

abstract int com.jogamp.opengl.GLContext.getDefaultReadFramebuffer ( )
abstract

Return the default read framebuffer name.

May differ from it's default zero in case an framebuffer object (com.jogamp.opengl.FBObject) based drawable is being used.

Method is only thread-safe while context is made current.

◆ getDefaultVAO()

abstract int com.jogamp.opengl.GLContext.getDefaultVAO ( )
abstract

If this GLContext does not implement a default VAO, see hasNoDefaultVAO(), an own default VAO will be created and bound at context creation.

If this GLContext does implement a default VAO, i.e. hasNoDefaultVAO() returns false, this method returns 0.

Otherwise this method returns the VAO object name representing this GLContext's own default VAO.

See also
hasNoDefaultVAO()

◆ getDestroyedShares()

final List< GLContext > com.jogamp.opengl.GLContext.getDestroyedShares ( )

Returns a new list of destroyed GLContext shared with this GLContext.

Definition at line 282 of file GLContext.java.

Here is the caller graph for this function:

◆ getDeviceVersionAvailableKey()

static String com.jogamp.opengl.GLContext.getDeviceVersionAvailableKey ( final AbstractGraphicsDevice  device,
final int  major,
final int  profile 
)
staticprotected

Returns a unique String object using String#intern() for the given arguments, which object reference itself can be used as a key.

Definition at line 1733 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDynamicLibraryBundle()

abstract DynamicLibraryBundle com.jogamp.opengl.GLContext.getDynamicLibraryBundle ( )
abstract

Returns the DynamicLibraryBundle, matching context.

◆ getGL()

abstract GL com.jogamp.opengl.GLContext.getGL ( )
abstract

Returns the GL pipeline object for this GLContext.

Returns
the aggregated GL instance, or null if this context was not yet made current.
Here is the caller graph for this function:

◆ getGLDebugMessageExtension()

abstract String com.jogamp.opengl.GLContext.getGLDebugMessageExtension ( )
abstract
Returns
The extension implementing the GLDebugOutput feature, either GLExtensions#ARB_debug_output or GLExtensions#AMD_debug_output. If unavailable or called before initialized via makeCurrent(), null is returned.

◆ getGLDrawable()

abstract GLDrawable com.jogamp.opengl.GLContext.getGLDrawable ( )
abstract

Returns the write-drawable this context uses for framebuffer operations.

If the read-drawable has not been changed manually via setGLReadDrawable(GLDrawable), it equals to the write-drawable (default).

Method is only thread-safe while context is made current.

See also
setGLDrawable(GLDrawable, boolean)
setGLReadDrawable(GLDrawable)
Here is the caller graph for this function:

◆ getGLExtensionCount()

abstract int com.jogamp.opengl.GLContext.getGLExtensionCount ( )
abstract

Returns the number of OpenGL extensions.

Here is the caller graph for this function:

◆ getGLExtensionsString()

abstract String com.jogamp.opengl.GLContext.getGLExtensionsString ( )
abstract

Returns a non-null (but possibly empty) string containing the space-separated list of available extensions.

Can only be called while this context is current. This is equivalent to glGetString(GL_EXTENSIONS)

Here is the caller graph for this function:

◆ getGLProfile() [1/2]

static String com.jogamp.opengl.GLContext.getGLProfile ( final int  major,
final int  minor,
final int  ctp 
) throws GLException
staticprotected

returns the highest GLProfile string regarding the implementation version and context profile bits.

Exceptions
GLExceptionif version and context profile bits could not be mapped to a GLProfile

Definition at line 1813 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGLProfile() [2/2]

static StringBuilder com.jogamp.opengl.GLContext.getGLProfile ( final StringBuilder  sb,
final int  ctp 
)
staticprotected

Definition at line 2048 of file GLContext.java.

◆ getGLReadDrawable()

abstract GLDrawable com.jogamp.opengl.GLContext.getGLReadDrawable ( )
abstract

Returns the read-Drawable this context uses for read framebuffer operations.

If the read-drawable has not been changed manually via setGLReadDrawable(GLDrawable), it equals to the write-drawable (default).

Method is only thread-safe while context is made current.

See also
isGLReadDrawableAvailable()
setGLReadDrawable(GLDrawable)
getGLReadDrawable()
Here is the caller graph for this function:

◆ getGLSLVersionString()

final String com.jogamp.opengl.GLContext.getGLSLVersionString ( )

Returns the matching GLSL version number, queried by this context GL via GL2ES2#GL_SHADING_LANGUAGE_VERSION if ≥ ES2.0 or GL2.0, otherwise a static match is being utilized.

The context must have been current once, otherwise the zero version instance is returned.

Examples w/ major.minor:

      1.00 (ES 2.0), 3.00 (ES 3.0)
      1.10 (GL 2.0), 1.20 (GL 2.1), 1.50 (GL 3.2),
      3.30 (GL 3.3), 4.00 (GL 4.0), 4.10 (GL 4.1), 4.20 (GL 4.2)
   

Matching could also refer to the maximum GLSL version usable by this context since normal GL implementations are capable of using a lower GLSL version as well. The latter is not true on OSX w/ a GL3 context.

Returns
GLSL version number if context has been made current at least once, otherwise the zero version instance is returned.
See also
getGLVersionNumber() */ public final VersionNumber getGLSLVersionNumber() { return ctxGLSLVersion; }

/** Returns the GLSL version string as to be used in a shader program, including a terminating newline '
', i.e. for desktop

      #version 110
      ..
      #version 150 core
      #version 330 compatibility
      ...
   

And for ES:

      #version 100
      #version 300 es
      ..
   

If context has not been made current yet, a string of zero length is returned.

See also
#getGLSLVersionNumber()

Definition at line 848 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getGLVendorVersionNumber()

final VersionNumberString com.jogamp.opengl.GLContext.getGLVendorVersionNumber ( )

Returns the vendor's version, i.e.

version number at the end of GL_VERSION not being the GL version.

In case no such version exists within GL_VERSION, the zero version instance is returned.

The vendor's version is usually the vendor's OpenGL driver version.

Definition at line 788 of file GLContext.java.

Here is the caller graph for this function:

◆ getGLVersion() [1/4]

final String com.jogamp.opengl.GLContext.getGLVersion ( )

Returns a valid OpenGL version string, ie

    major.minor ([option]?[options,]*) - gl-version

<br<blockquote>‍

  • options
    • ES profile ES profile
    • Compatibility profile Compatibility profile including fixed function pipeline and deprecated functionality
    • Core profile Core profile
    • forward Forward profile excluding deprecated functionality
    • arb refers to an ARB_create_context created context
    • debug refers to a debug context
    • ES2 compatible refers to an ES2 compatible implementation
    • software refers to a software implementation of the rasterizer
    • hardware refers to a hardware implementation of the rasterizer
  • gl-version the GL_VERSION string

e.g.:

row 2, cell 1 row 2, cell 2
ES2 2.0 (ES profile, ES2 compatible, hardware) - 2.0 ES Profile
ATIGL2 3.0 (Compatibility profile, arb, hardware) - 3.2.9704 Compatibility Profile Context
ATIGL3 3.3 (Core profile, any, new, hardware) - 1.4 (3.2.9704 Compatibility Profile Context)
ATIGL3bc3.3 (Compatibility profile, arb, hardware) - 1.4 (3.2.9704 Compatibility Profile Context)
NVGL2 3.0 (Compatibility profile, arb, hardware) - 3.0.0 NVIDIA 195.36.07.03
NVGL3 3.3 (Core profile, arb, hardware) - 3.3.0 NVIDIA 195.36.07.03
NVGL3bc 3.3 (Compatibility profile, arb, hardware) - 3.3.0 NVIDIA 195.36.07.03
NVGL2 3.0 (Compatibility profile, arb, ES2 compatible, hardware) - 3.0.0 NVIDIA 290.10

Definition at line 769 of file GLContext.java.

Here is the caller graph for this function:

◆ getGLVersion() [2/4]

static String com.jogamp.opengl.GLContext.getGLVersion ( final int  major,
final int  minor,
final int  ctp,
final String  gl_version 
)
staticprotected

Definition at line 2091 of file GLContext.java.

Here is the call graph for this function:

◆ getGLVersion() [3/4]

static StringBuilder com.jogamp.opengl.GLContext.getGLVersion ( final StringBuilder  sb,
final int  major,
final int  minor,
final int  ctp,
final String  gl_version 
)
staticprotected

Definition at line 2078 of file GLContext.java.

Here is the call graph for this function:

◆ getGLVersion() [4/4]

static StringBuilder com.jogamp.opengl.GLContext.getGLVersion ( final StringBuilder  sb,
final VersionNumber  version,
final int  ctp,
final String  gl_version 
)
staticprotected

Definition at line 2075 of file GLContext.java.

Here is the call graph for this function:

◆ getGLVersionNumber()

final VersionNumber com.jogamp.opengl.GLContext.getGLVersionNumber ( )

Returns this context OpenGL version.

See also
#getGLSLVersionNumber()

Definition at line 777 of file GLContext.java.

Here is the caller graph for this function:

◆ getHandle()

final long com.jogamp.opengl.GLContext.getHandle ( )

Returns the underlying native OpenGL context handle.

Definition at line 599 of file GLContext.java.

Here is the caller graph for this function:

◆ getMaxMajor()

static final int com.jogamp.opengl.GLContext.getMaxMajor ( final int  ctxProfile)
static

Definition at line 1536 of file GLContext.java.

◆ getMaxMinor()

static final int com.jogamp.opengl.GLContext.getMaxMinor ( final int  ctxProfile,
final int  major 
)
static

Definition at line 1540 of file GLContext.java.

◆ getMaxRenderbufferSamples()

final int com.jogamp.opengl.GLContext.getMaxRenderbufferSamples ( )

Returns the maximum number of FBO RENDERBUFFER samples if full FBO is supported, otherwise false.

Definition at line 1005 of file GLContext.java.

Here is the call graph for this function:

◆ getPlatformExtensionCount()

abstract int com.jogamp.opengl.GLContext.getPlatformExtensionCount ( )
abstract

Returns the number of platform extensions.

Here is the caller graph for this function:

◆ getPlatformExtensionsString()

abstract String com.jogamp.opengl.GLContext.getPlatformExtensionsString ( )
abstract

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.

Here is the caller graph for this function:

◆ getRendererQuirks()

final GLRendererQuirks com.jogamp.opengl.GLContext.getRendererQuirks ( )

Returns the instance of GLRendererQuirks, allowing one to determine workarounds.

Returns
instance of GLRendererQuirks if context was made current once, otherwise null.

Definition at line 290 of file GLContext.java.

Here is the caller graph for this function:

◆ getRequestMajorAndCompat()

static final void com.jogamp.opengl.GLContext.getRequestMajorAndCompat ( final GLProfile  glp,
final int[]  reqMajorCTP 
)
staticprotected

Returns the GLProfile's major version number at reqMajorCTP[0] and it's context property (CTP) at reqMajorCTP[1] for availability mapping request.

Definition at line 1833 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRootGL()

abstract GL com.jogamp.opengl.GLContext.getRootGL ( )
abstract

Returns the implementing root GL instance of this GLContext's GL object, considering a wrapped pipelined hierarchy, see GLBase#getDownstreamGL().

Exceptions
GLExceptionif the root instance is not a GL implementation
See also
GLBase::getRootGL()
GLBase::getDownstreamGL()
getGL()
setGL(GL)

◆ getSharedMaster()

final GLContext com.jogamp.opengl.GLContext.getSharedMaster ( )

Returns the shared master GLContext of this GLContext if shared, otherwise return null.

Returns this GLContext, if it is a shared master.

Since
2.2.1

Definition at line 272 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getStaticGLSLVersionNumber()

static final VersionNumber com.jogamp.opengl.GLContext.getStaticGLSLVersionNumber ( final int  glMajorVersion,
final int  glMinorVersion,
final int  ctxOptions 
)
staticprotected

Definition at line 866 of file GLContext.java.

◆ getSwapGroup()

int com.jogamp.opengl.GLContext.getSwapGroup ( )

Definition at line 1319 of file GLContext.java.

◆ getSwapInterval()

int com.jogamp.opengl.GLContext.getSwapInterval ( )

Return the current swap interval.

If the context has not been made current at all, the default value 0 is returned.

For a valid context w/ an <o>onscreen GLDrawable the default value is 1, otherwise the default value is 0.

See also
setSwapInterval(int)

Definition at line 1296 of file GLContext.java.

◆ getThreadName()

static String com.jogamp.opengl.GLContext.getThreadName ( )
staticprotected

Definition at line 2118 of file GLContext.java.

Here is the caller graph for this function:

◆ glDebugMessageControl() [1/2]

abstract void com.jogamp.opengl.GLContext.glDebugMessageControl ( int  source,
int  type,
int  severity,
int  count,
int[]  ids,
int  ids_offset,
boolean  enabled 
)
abstract

◆ glDebugMessageControl() [2/2]

abstract void com.jogamp.opengl.GLContext.glDebugMessageControl ( int  source,
int  type,
int  severity,
int  count,
IntBuffer  ids,
boolean  enabled 
)
abstract

◆ glDebugMessageInsert()

abstract void com.jogamp.opengl.GLContext.glDebugMessageInsert ( int  source,
int  type,
int  id,
int  severity,
String  buf 
)
abstract

◆ hasBasicFBOSupport()

final boolean com.jogamp.opengl.GLContext.hasBasicFBOSupport ( )

Returns true if basic FBO support is available, otherwise false.

Basic FBO is supported if the context is either GL-ES >= 2.0, GL >= 3.0 [core, compat] or implements the extensions GL_ARB_ES2_compatibility, GL_ARB_framebuffer_object, GL_EXT_framebuffer_object or GL_OES_framebuffer_object.

Basic FBO support may only include one color attachment and no multisampling, as well as limited internal formats for renderbuffer.

See also
CTX_IMPL_FBO

Definition at line 964 of file GLContext.java.

Here is the caller graph for this function:

◆ hasFP32CompatAPI()

final boolean com.jogamp.opengl.GLContext.hasFP32CompatAPI ( )

Returns true if OES_single_precision, fp32, fixed function point (FFP) compatibility entry points available, otherwise false.

See also
CTX_IMPL_FP32_COMPAT_API

Definition at line 997 of file GLContext.java.

◆ hasFullFBOSupport()

final boolean com.jogamp.opengl.GLContext.hasFullFBOSupport ( )

Returns true if full FBO support is available, otherwise false.

Full FBO is supported if the context is either GL >= 3.0 [ES, core, compat] or implements the extensions ARB_framebuffer_object, or all of EXT_framebuffer_object, EXT_framebuffer_multisample, EXT_framebuffer_blit, GL_EXT_packed_depth_stencil.

Full FBO support includes multiple color attachments and multisampling.

Definition at line 980 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ hasGLSL()

final boolean com.jogamp.opengl.GLContext.hasGLSL ( )
Returns
true if context supports GLSL, i.e. is either isGLES3(), isGLES2(), isGL3() or isGL2() and major-version > 1.
See also
GLProfile::hasGLSL()

Definition at line 945 of file GLContext.java.

Here is the call graph for this function:

◆ hasNoDefaultVAO()

final boolean com.jogamp.opengl.GLContext.hasNoDefaultVAO ( )

Indicates whether this GLContext's native profile does not implement a default vertex array object (VAO), starting w/ OpenGL 3.1 core.

Includes [ GL4, GL3 ].

Due to GL 3.1 core spec: E.1. DEPRECATED AND REMOVED FEATURES (p 296),
       GL 3.2 core spec: E.2. DEPRECATED AND REMOVED FEATURES (p 331)
there is no more default VAO buffer 0 bound, hence generating and binding one
to avoid INVALID_OPERATION at VertexAttribPointer.
More clear is GL 4.3 core spec: 10.4 (p 307).
ES 3.x is not included here.
Due to it's ES 2.0 backward compatibility it still supports the following features:
       client side vertex arrays
       default vertex array object

Binding a custom VAO with ES 3.0 would cause client side vertex arrays via  glVertexPointer
to produce GL_INVALID_OPERATION.

However, they are marked deprecated:
       GL ES 3.0 spec F.1. Legacy Features (p 322).
       GL ES 3.1 spec F.1. Legacy Features (p 454).

If no default VAO is implemented in the native OpenGL profile, an own default VAO is being used, see getDefaultVAO().

See also
getDefaultVAO()

Definition at line 1135 of file GLContext.java.

◆ hasRendererQuirk()

final boolean com.jogamp.opengl.GLContext.hasRendererQuirk ( final int  quirk) throws IllegalArgumentException

Returns true if the quirk exist in getRendererQuirks(), otherwise false.

Convenience method for:

   final GLRendererQuirks glrq = ctx.getRendererQuirks();
   boolean hasQuirk = null != glrq ? glrq.exist(quirk) : false ;
Parameters
quirkthe quirk to be tested, e.g. GLRendererQuirks#NoDoubleBufferedPBuffer.
Exceptions
IllegalArgumentExceptionif the quirk is out of range

Definition at line 304 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCPUDataSourcingAvail()

final boolean com.jogamp.opengl.GLContext.isCPUDataSourcingAvail ( )

Indicates whether this GLContext allows CPU data sourcing (indices, vertices ..) as opposed to using a GPU buffer source (VBO), e.g.

GL2#glDrawElements(int, int, int, java.nio.Buffer).

Includes [GL2ES1, GLES2] == [ GL4bc, GL3bc, GL2, GLES1, GL2ES1, GLES2 ].

See Bug 852 - https://jogamp.org/bugzilla/show_bug.cgi?id=852

Definition at line 1101 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCreated()

final boolean com.jogamp.opengl.GLContext.isCreated ( )

Indicates whether the underlying native OpenGL context has been created.

Definition at line 604 of file GLContext.java.

Here is the caller graph for this function:

◆ isCreatedWithARBMethod()

final boolean com.jogamp.opengl.GLContext.isCreatedWithARBMethod ( )

Definition at line 794 of file GLContext.java.

Here is the caller graph for this function:

◆ isCurrent()

final boolean com.jogamp.opengl.GLContext.isCurrent ( )
Returns
true if this GLContext is current on this thread

Definition at line 522 of file GLContext.java.

Here is the call graph for this function:

◆ isExtensionAvailable()

abstract boolean com.jogamp.opengl.GLContext.isExtensionAvailable ( String  glExtensionName)
abstract

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.

Parameters
glExtensionNamethe name of the OpenGL extension (e.g., "GL_VERTEX_PROGRAM_ARB").
Here is the caller graph for this function:

◆ isFBOAvailable()

static final boolean com.jogamp.opengl.GLContext.isFBOAvailable ( final AbstractGraphicsDevice  device,
final GLProfile  glp 
)
static

Returns true if it is possible to create an framebuffer object (FBO).

FBO feature is implemented in OpenGL, hence it is GLProfile dependent.

FBO support is queried as described in hasBasicFBOSupport().

Parameters
devicethe device to request whether FBO is available for
glpGLProfile to check for FBO capabilities
See also
GLContext::hasBasicFBOSupport()

Definition at line 1928 of file GLContext.java.

Here is the call graph for this function:

◆ isFunctionAvailable()

abstract boolean com.jogamp.opengl.GLContext.isFunctionAvailable ( String  glFunctionName)
abstract

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.

Parameters
glFunctionNamethe name of the OpenGL function (e.g., use "glPolygonOffsetEXT" or "glPolygonOffset" to check if the com.jogamp.opengl.GL#glPolygonOffset(float,float) is available).

◆ isGL2()

final boolean com.jogamp.opengl.GLContext.isGL2 ( )

Indicates whether this GLContext is capable of GL2.

Includes [ GL4bc, GL3bc, GL2 ].

See also
GLProfile::isGL2()

Definition at line 1162 of file GLContext.java.

Here is the caller graph for this function:

◆ isGL2Available()

static boolean com.jogamp.opengl.GLContext.isGL2Available ( final AbstractGraphicsDevice  device,
final boolean  isHardware[] 
)
static

Definition at line 2044 of file GLContext.java.

Here is the call graph for this function:

◆ isGL2ES1()

final boolean com.jogamp.opengl.GLContext.isGL2ES1 ( )

Indicates whether this GLContext is capable of GL2ES1.

Includes [ GL4bc, GL3bc, GL2, GLES1, GL2ES1 ].

See also
GLProfile::isGL2ES1()

Definition at line 1215 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isGL2ES2()

final boolean com.jogamp.opengl.GLContext.isGL2ES2 ( )

Indicates whether this GLContext is capable of GL2ES2.

Includes [ GL4bc, GL4, GL3bc, GL3, GLES3, GL2, GL2GL3, GL2ES2, GLES2 ].

See also
GLProfile::isGL2ES2()

Definition at line 1223 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isGL2ES3()

final boolean com.jogamp.opengl.GLContext.isGL2ES3 ( )

Indicates whether this GLContext is capable of GL2ES3.

Includes [ GL4bc, GL4, GL3bc, GL3, GLES3, GL3ES3, GL2, GL2GL3 ].

See also
GLProfile::isGL2ES3()
isGL3ES3()
isGL2GL3()

Definition at line 1233 of file GLContext.java.

Here is the call graph for this function:

◆ isGL2GL3()

final boolean com.jogamp.opengl.GLContext.isGL2GL3 ( )

Indicates whether this GLContext is capable of GL2GL3.

Includes [ GL4bc, GL4, GL3bc, GL3, GL2, GL2GL3 ].

See also
GLProfile::isGL2GL3()

Definition at line 1170 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isGL3()

final boolean com.jogamp.opengl.GLContext.isGL3 ( )

Indicates whether this GLContext is capable of GL3.

Includes [ GL4bc, GL4, GL3bc, GL3 ].

See also
GLProfile::isGL3()

Definition at line 1072 of file GLContext.java.

Here is the caller graph for this function:

◆ isGL3Available()

static boolean com.jogamp.opengl.GLContext.isGL3Available ( final AbstractGraphicsDevice  device,
final boolean  isHardware[] 
)
static

Definition at line 2040 of file GLContext.java.

Here is the call graph for this function:

◆ isGL3bc()

final boolean com.jogamp.opengl.GLContext.isGL3bc ( )

Indicates whether this GLContext is capable of GL3bc.

Includes [ GL4bc, GL3bc ].

See also
GLProfile::isGL3bc()

Definition at line 1063 of file GLContext.java.

Here is the caller graph for this function:

◆ isGL3bcAvailable()

static boolean com.jogamp.opengl.GLContext.isGL3bcAvailable ( final AbstractGraphicsDevice  device,
final boolean  isHardware[] 
)
static

Definition at line 2036 of file GLContext.java.

Here is the call graph for this function:

◆ isGL3core()

final boolean com.jogamp.opengl.GLContext.isGL3core ( )

Indicates whether this GLContext uses a GL3 core profile.

Includes [ GL4, GL3 ].

Definition at line 1080 of file GLContext.java.

◆ isGL3ES3()

final boolean com.jogamp.opengl.GLContext.isGL3ES3 ( )

Indicates whether this GLContext is capable of GL3ES3.

Includes [ GL4bc, GL4, GL3bc, GL3, GLES3 ].

See also
GLProfile::isGL3ES3()

Definition at line 1241 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isGL4()

final boolean com.jogamp.opengl.GLContext.isGL4 ( )

Indicates whether this GLContext is capable of GL4.

Includes [ GL4bc, GL4 ].

See also
GLProfile::isGL4()

Definition at line 1046 of file GLContext.java.

Here is the caller graph for this function:

◆ isGL4Available()

static boolean com.jogamp.opengl.GLContext.isGL4Available ( final AbstractGraphicsDevice  device,
final boolean  isHardware[] 
)
static

Definition at line 2032 of file GLContext.java.

Here is the call graph for this function:

◆ isGL4bc()

final boolean com.jogamp.opengl.GLContext.isGL4bc ( )

Indicates whether this GLContext is capable of GL4bc.

Includes [ GL4bc ].

See also
GLProfile::isGL4bc()

Definition at line 1037 of file GLContext.java.

Here is the caller graph for this function:

◆ isGL4bcAvailable()

static boolean com.jogamp.opengl.GLContext.isGL4bcAvailable ( final AbstractGraphicsDevice  device,
final boolean  isHardware[] 
)
static

Definition at line 2028 of file GLContext.java.

Here is the call graph for this function:

◆ isGL4core()

final boolean com.jogamp.opengl.GLContext.isGL4core ( )

Indicates whether this GLContext uses a GL4 core profile.

Includes [ GL4 ].

Definition at line 1054 of file GLContext.java.

◆ isGL4ES3()

final boolean com.jogamp.opengl.GLContext.isGL4ES3 ( )

Returns true if this profile is capable of GL4ES3, i.e.

if isGLES3Compatible() returns true.

Includes [ GL ≥ 4.3, GL ≥ 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]

See also
GLProfile::isGL4ES3()

Definition at line 1250 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isGLCompatibilityProfile()

final boolean com.jogamp.opengl.GLContext.isGLCompatibilityProfile ( )

Definition at line 789 of file GLContext.java.

Here is the caller graph for this function:

◆ isGLcore()

final boolean com.jogamp.opengl.GLContext.isGLcore ( )

Indicates whether this GLContext uses a GL core profile.

Includes [ GL4, GL3, GLES3, GLES2 ].

Definition at line 1088 of file GLContext.java.

◆ isGLCoreProfile()

final boolean com.jogamp.opengl.GLContext.isGLCoreProfile ( )

Definition at line 790 of file GLContext.java.

Here is the caller graph for this function:

◆ isGLDebugEnabled()

final boolean com.jogamp.opengl.GLContext.isGLDebugEnabled ( )

Definition at line 793 of file GLContext.java.

◆ isGLDebugMessageEnabled()

abstract boolean com.jogamp.opengl.GLContext.isGLDebugMessageEnabled ( )
abstract
Returns
true if the GLDebugOutput feature is enabled or not.
Here is the caller graph for this function:

◆ isGLDebugSynchronous()

abstract boolean com.jogamp.opengl.GLContext.isGLDebugSynchronous ( )
abstract
Returns
the current synchronous debug behavior, set via setGLDebugSynchronous(boolean).

◆ isGLES()

final boolean com.jogamp.opengl.GLContext.isGLES ( )

Indicates whether this GLContext is capable of GLES.

Includes [ GLES3, GLES1, GLES2 ].

See also
GLProfile::isGLES()

Definition at line 1207 of file GLContext.java.

Here is the caller graph for this function:

◆ isGLES1()

final boolean com.jogamp.opengl.GLContext.isGLES1 ( )

Indicates whether this GLContext is capable of GLES1.

Includes [ GLES1 ].

See also
GLProfile::isGLES1()

Definition at line 1178 of file GLContext.java.

Here is the caller graph for this function:

◆ isGLES1Available()

static boolean com.jogamp.opengl.GLContext.isGLES1Available ( final AbstractGraphicsDevice  device,
final boolean  isHardware[] 
)
static

Definition at line 1966 of file GLContext.java.

Here is the call graph for this function:

◆ isGLES2()

final boolean com.jogamp.opengl.GLContext.isGLES2 ( )

Indicates whether this GLContext is capable of GLES2.

Includes [ GLES2, GLES3 ].

See also
GLProfile::isGLES2()

Definition at line 1186 of file GLContext.java.

Here is the caller graph for this function:

◆ isGLES2Available()

static boolean com.jogamp.opengl.GLContext.isGLES2Available ( final AbstractGraphicsDevice  device,
final boolean  isHardware[] 
)
static

Definition at line 1970 of file GLContext.java.

Here is the call graph for this function:

◆ isGLES2Compatible()

final boolean com.jogamp.opengl.GLContext.isGLES2Compatible ( )
Returns
true if this context is an ES2 context or implements the extension GL_ARB_ES3_compatibility or GL_ARB_ES2_compatibility, otherwise false

Definition at line 895 of file GLContext.java.

Here is the caller graph for this function:

◆ isGLES3()

final boolean com.jogamp.opengl.GLContext.isGLES3 ( )

Indicates whether this GLContext is capable of GLES3.

Includes [ GLES3 ].

See also
GLProfile::isGLES3()

Definition at line 1199 of file GLContext.java.

Here is the caller graph for this function:

◆ isGLES31Compatible()

final boolean com.jogamp.opengl.GLContext.isGLES31Compatible ( )

Return true if this context is an ES3 context ≥ 3.1 or implements the extension GL_ARB_ES3_1_compatibility, otherwise false.

Includes [ GL ≥ 4.5, GL ≥ 3.1 w/ GL_ARB_ES3_1_compatibility and GLES3 ≥ 3.1 ]

Definition at line 917 of file GLContext.java.

◆ isGLES31CompatibleAvailable()

static final boolean com.jogamp.opengl.GLContext.isGLES31CompatibleAvailable ( final AbstractGraphicsDevice  device)
static

Returns true if a ES3 ≥ 3.1 compatible profile is available, i.e.

either a ≥ 4.5 context or a ≥ 3.1 context supporting GL_ARB_ES3_1_compatibility, otherwise false.

Includes [ GL ≥ 4.5, GL ≥ 3.1 w/ GL_ARB_ES3_1_compatibility and GLES3 ≥ 3.1 ]

Definition at line 2013 of file GLContext.java.

◆ isGLES32Compatible()

final boolean com.jogamp.opengl.GLContext.isGLES32Compatible ( )

Return true if this context is an ES3 context ≥ 3.2 or implements the extension GL_ARB_ES3_2_compatibility, otherwise false.

Includes [ GL ≥ 4.5, GL ≥ 3.1 w/ GL_ARB_ES3_2_compatibility and GLES3 ≥ 3.2 ]

Definition at line 928 of file GLContext.java.

◆ isGLES32CompatibleAvailable()

static final boolean com.jogamp.opengl.GLContext.isGLES32CompatibleAvailable ( final AbstractGraphicsDevice  device)
static

Returns true if a ES3 ≥ 3.2 compatible profile is available, i.e.

either a ≥ 4.5 context or a ≥ 3.1 context supporting GL_ARB_ES3_2_compatibility, otherwise false.

Includes [ GL ≥ 4.5, GL ≥ 3.1 w/ GL_ARB_ES3_2_compatibility and GLES3 ≥ 3.2 ]

Definition at line 2024 of file GLContext.java.

◆ isGLES3Available()

static boolean com.jogamp.opengl.GLContext.isGLES3Available ( final AbstractGraphicsDevice  device,
final boolean  isHardware[] 
)
static

Definition at line 1974 of file GLContext.java.

Here is the call graph for this function:

◆ isGLES3Compatible()

final boolean com.jogamp.opengl.GLContext.isGLES3Compatible ( )

Return true if this context is an ES3 context or implements the extension GL_ARB_ES3_compatibility, otherwise false.

Includes [ GL ≥ 4.3, GL ≥ 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]

Definition at line 906 of file GLContext.java.

Here is the caller graph for this function:

◆ isGLES3CompatibleAvailable()

static final boolean com.jogamp.opengl.GLContext.isGLES3CompatibleAvailable ( final AbstractGraphicsDevice  device)
static

Returns true if a ES3 compatible profile is available, i.e.

either a ≥ 4.3 context or a ≥ 3.1 context supporting GL_ARB_ES3_compatibility, otherwise false.

Includes [ GL ≥ 4.3, GL ≥ 3.1 w/ GL_ARB_ES3_compatibility and GLES3 ]

Definition at line 2002 of file GLContext.java.

Here is the caller graph for this function:

◆ isGLESProfile()

final boolean com.jogamp.opengl.GLContext.isGLESProfile ( )

Definition at line 791 of file GLContext.java.

◆ isGLForwardCompatible()

final boolean com.jogamp.opengl.GLContext.isGLForwardCompatible ( )

Definition at line 792 of file GLContext.java.

◆ isGLReadDrawableAvailable()

abstract boolean com.jogamp.opengl.GLContext.isGLReadDrawableAvailable ( )
abstract

Query whether using a distinguished read-drawable is supported.

Returns
true if using a read-drawable is supported with your driver/OS, otherwise false.

◆ isGLVersionAvailable()

static boolean com.jogamp.opengl.GLContext.isGLVersionAvailable ( final AbstractGraphicsDevice  device,
final int  reqMajor,
final int  reqProfile,
final boolean  isHardware[] 
)
staticprotected
Parameters
devicethe device to request whether the profile is available for
reqMajorKey Value either 1, 2, 3 or 4
reqProfileKey Value either CTX_PROFILE_COMPAT, CTX_PROFILE_CORE or CTX_PROFILE_ES
isHardwarereturn value of one boolean, whether the profile is a hardware rasterizer or not
Returns
true if the requested GL version is available regardless of a software or hardware rasterizer, otherwise false.

Definition at line 1957 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isHardwareRasterizer() [1/2]

final boolean com.jogamp.opengl.GLContext.isHardwareRasterizer ( )
Returns
true if impl. is a hardware rasterizer, otherwise false.
See also
isHardwareRasterizer(AbstractGraphicsDevice, GLProfile)
GLProfile::isHardwareRasterizer()

Definition at line 937 of file GLContext.java.

◆ isHardwareRasterizer() [2/2]

static final int com.jogamp.opengl.GLContext.isHardwareRasterizer ( final AbstractGraphicsDevice  device,
final GLProfile  glp 
)
static
Returns
1 if using a hardware rasterizer, 0 if using a software rasterizer and -1 if not determined yet.
See also
GLContext::isHardwareRasterizer()
GLProfile::isHardwareRasterizer()

Definition at line 1937 of file GLContext.java.

Here is the call graph for this function:

◆ isNPOTTextureAvailable()

boolean com.jogamp.opengl.GLContext.isNPOTTextureAvailable ( )

Note: The GL impl.

may return a const value, ie GLES2#isNPOTTextureAvailable() always returns true.

Definition at line 1023 of file GLContext.java.

Here is the call graph for this function:

◆ isShared()

final boolean com.jogamp.opengl.GLContext.isShared ( )

Returns true if this GLContext is shared, otherwise false.

Definition at line 261 of file GLContext.java.

Here is the caller graph for this function:

◆ isTextureFormatBGRA8888Available()

boolean com.jogamp.opengl.GLContext.isTextureFormatBGRA8888Available ( )

Definition at line 1027 of file GLContext.java.

Here is the call graph for this function:

◆ isValidGLVersion()

static final boolean com.jogamp.opengl.GLContext.isValidGLVersion ( final int  ctxProfile,
final int  major,
final int  minor 
)
static

Returns true, if the major.minor is not inferior to the lowest valid version and does not exceed the highest known major number by more than one.

Otherwise returns false.

Returns false if more than one bit of the following list in ctxProfile is set

The minor version number is ignored by the upper limit validation and the major version number may exceed by one.

The upper limit check is relaxed since we don't want to cut-off unforseen new GL version since the release of JOGL.

Hence it is important to iterate through GL version from the upper limit and decrementGLVersion(int, int[], int[]) until invalid.

Definition at line 1578 of file GLContext.java.

Here is the caller graph for this function:

◆ joinSwapGroup()

final boolean com.jogamp.opengl.GLContext.joinSwapGroup ( final int  group)

Definition at line 1313 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ joinSwapGroupImpl()

boolean com.jogamp.opengl.GLContext.joinSwapGroupImpl ( final int  group)
protected

Definition at line 1317 of file GLContext.java.

Here is the caller graph for this function:

◆ makeCurrent()

abstract int com.jogamp.opengl.GLContext.makeCurrent ( ) throws GLException
abstract

Makes this GLContext current on the calling thread.

Recursive call to makeCurrent() and hence release() are supported.

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 for the 1st time, or that the state of the underlying context or drawable has changed since the last time this context was current. In this case, the application may wish to initialize the render state.

A return value of CONTEXT_CURRENT indicates that the context has been made current, 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.

This method is blocking, i.e. waits until another thread has released the context.

The drawable's surface is being locked at entry and unlocked at release()

Returns
Exceptions
GLExceptionif the context could not be created or made current due to non-recoverable, system-specific errors.
Here is the caller graph for this function:

◆ makeCurrentResultToString()

static final String com.jogamp.opengl.GLContext.makeCurrentResultToString ( final int  res)
static

Returns a String representation of the makeCurrent() result.

Definition at line 536 of file GLContext.java.

◆ queryMaxSwapGroups()

final boolean com.jogamp.opengl.GLContext.queryMaxSwapGroups ( final int[]  maxGroups,
final int  maxGroups_offset,
final int[]  maxBarriers,
final int  maxBarriers_offset 
)

Definition at line 1306 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ queryMaxSwapGroupsImpl()

boolean com.jogamp.opengl.GLContext.queryMaxSwapGroupsImpl ( final int[]  maxGroups,
final int  maxGroups_offset,
final int[]  maxBarriers,
final int  maxBarriers_offset 
)
protected

Definition at line 1311 of file GLContext.java.

Here is the caller graph for this function:

◆ release()

abstract void com.jogamp.opengl.GLContext.release ( ) throws GLException
abstract

Releases control of this GLContext from the current thread.

Recursive call to release() and hence makeCurrent() are supported.

The drawable's surface is being unlocked at exit, assumed to be locked by makeCurrent().

Exceptions
GLExceptionif the context had not previously been made current on the current thread
Here is the caller graph for this function:

◆ removeGLDebugListener()

abstract void com.jogamp.opengl.GLContext.removeGLDebugListener ( GLDebugListener  listener)
abstract

◆ resetStates()

void com.jogamp.opengl.GLContext.resetStates ( final boolean  isInit)
protected
Parameters
isInittrue if called for class initialization, otherwise false (re-init or destruction).

Definition at line 244 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAvailableGLVersionsSet()

static void com.jogamp.opengl.GLContext.setAvailableGLVersionsSet ( final AbstractGraphicsDevice  device,
final boolean  set 
)
staticprotected

Definition at line 1714 of file GLContext.java.

Here is the call graph for this function:

◆ setContextCreationFlags()

abstract void com.jogamp.opengl.GLContext.setContextCreationFlags ( int  flags)
abstract
Parameters
flagsAdditional context creation flags, supported: GLContext#CTX_OPTION_DEBUG. Unsupported flags are masked out. Only affects this context state if not created yet via makeCurrent().
See also
enableGLDebugMessage(boolean)
GLAutoDrawable::setContextCreationFlags(int)
Here is the caller graph for this function:

◆ setCurrent()

static void com.jogamp.opengl.GLContext.setCurrent ( final GLContext  cur)
staticprotected

Sets the thread-local variable returned by getCurrent and has no other side-effects.

For use by third parties adding new GLContext implementations; not for use by end users.

Definition at line 550 of file GLContext.java.

Here is the call graph for this function:

◆ setDefaultSwapInterval()

void com.jogamp.opengl.GLContext.setDefaultSwapInterval ( )
protected

Definition at line 1301 of file GLContext.java.

◆ setGL()

abstract GL com.jogamp.opengl.GLContext.setGL ( GL  gl)
abstract

Sets the GL pipeline object for this GLContext.

Returns
the set GL pipeline or null if not successful
Here is the caller graph for this function:

◆ setGLDebugSynchronous()

abstract void com.jogamp.opengl.GLContext.setGLDebugSynchronous ( boolean  synchronous)
abstract

Enables or disables the synchronous debug behavior via glEnable/glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS), if extension is GLExtensions#ARB_debug_output.

There is no equivalent for GLExtensions#AMD_debug_output.

The default is true, ie GL2GL3#GL_DEBUG_OUTPUT_SYNCHRONOUS.

#isGLDebugSynchronous()}

◆ setGLDrawable()

abstract GLDrawable com.jogamp.opengl.GLContext.setGLDrawable ( GLDrawable  readWrite,
boolean  setWriteOnly 
)
abstract

Sets the read/write drawable for framebuffer operations, i.e.

reassociation of the context's drawable.

If the arguments reflect the current state of this context this method is a no-operation and returns the old and current GLDrawable.

Remarks:

Parameters
readWriteThe read/write drawable for framebuffer operations, maybe null to remove association.
setWriteOnlyOnly change the write-drawable, if setWriteOnly is true and if the read-drawable differs from the write-drawable. Otherwise set both drawables, read and write.
Returns
The previous read/write drawable if operation succeeds
Exceptions
GLExceptionin case null is being passed, this context is made current on another thread or operation fails.
See also
isGLReadDrawableAvailable()
setGLReadDrawable(GLDrawable)
getGLReadDrawable()
setGLDrawable(GLDrawable, boolean)
getGLDrawable()

◆ setGLReadDrawable()

abstract GLDrawable com.jogamp.opengl.GLContext.setGLReadDrawable ( GLDrawable  read)
abstract

Set the read-Drawable for read framebuffer operations.


The caller should query if this feature is supported via isGLReadDrawableAvailable().

If the context was current on this thread, it is being released before switching the drawable and made current afterwards. However the user shall take extra care that not other thread attempts to make this context current. Otherwise a race condition may happen.

Parameters
readthe read-drawable for read framebuffer operations. If null is passed, the default write drawable will be set.
Returns
the previous read-drawable
Exceptions
GLExceptionin case a read drawable is not supported or this context is made current on another thread.
See also
isGLReadDrawableAvailable()
getGLReadDrawable()
Here is the caller graph for this function:

◆ setSwapInterval()

boolean com.jogamp.opengl.GLContext.setSwapInterval ( final int  interval) throws GLException

Set the swap interval of the current context and attached onscreen GLDrawable.

offscreen GLDrawable are ignored and false is returned.

The interval semantics:

  • 0 disables the vertical synchronization
  • ≥1 is the number of vertical refreshes before a swap buffer occurs
  • <0 enables late swaps to occur without synchronization to the video frame, a.k.a EXT_swap_control_tear. If supported, the absolute value is the minimum number of video frames between buffer swaps. If not supported, the absolute value is being used, see above.
Parameters
intervalsee above
Returns
true if the operation was successful, otherwise false
Exceptions
GLExceptionif the context is not current.
See also
getSwapInterval()

Definition at line 1275 of file GLContext.java.

◆ setSwapIntervalImpl()

boolean com.jogamp.opengl.GLContext.setSwapIntervalImpl ( final int  interval)
protected

Definition at line 1279 of file GLContext.java.

◆ shutdown()

static void com.jogamp.opengl.GLContext.shutdown ( )
staticprotected

clears the device/context mappings as well as the GL/GLX proc address tables.

Definition at line 1702 of file GLContext.java.

◆ toHexString() [1/2]

static String com.jogamp.opengl.GLContext.toHexString ( final int  hex)
staticprotected

Definition at line 2099 of file GLContext.java.

Here is the caller graph for this function:

◆ toHexString() [2/2]

static String com.jogamp.opengl.GLContext.toHexString ( final long  hex)
staticprotected

Definition at line 2103 of file GLContext.java.

◆ toString()

String com.jogamp.opengl.GLContext.toString ( )

Classname, GL, GLDrawable.

Definition at line 631 of file GLContext.java.

Here is the call graph for this function:

◆ validateCurrent()

final void com.jogamp.opengl.GLContext.validateCurrent ( ) throws GLException
Exceptions
GLExceptionif this GLContext is not current on this thread

Definition at line 529 of file GLContext.java.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ validateProfileBits()

static void com.jogamp.opengl.GLContext.validateProfileBits ( final int  bits,
final String  argName 
)
staticprotected

Definition at line 1677 of file GLContext.java.

Member Data Documentation

◆ CONTEXT_CURRENT

final int com.jogamp.opengl.GLContext.CONTEXT_CURRENT = 1
static

Indicates that the context was made current during the last call to makeCurrent, value {@value}.

Definition at line 114 of file GLContext.java.

◆ CONTEXT_CURRENT_NEW

final int com.jogamp.opengl.GLContext.CONTEXT_CURRENT_NEW = 2
static

Indicates that a newly-created context was made current during the last call to makeCurrent, value {@value}.

Definition at line 116 of file GLContext.java.

◆ CONTEXT_NOT_CURRENT

final int com.jogamp.opengl.GLContext.CONTEXT_NOT_CURRENT = 0
static

Indicates that the context was not made current during the last call to makeCurrent, value {@value}.

Definition at line 112 of file GLContext.java.

◆ contextHandle

volatile long com.jogamp.opengl.GLContext.contextHandle
protected

The underlying native OpenGL context.

Definition at line 225 of file GLContext.java.

◆ CTX_IMPL_ACCEL_SOFT

final int com.jogamp.opengl.GLContext.CTX_IMPL_ACCEL_SOFT = 1 << 6
staticprotected

Context uses software rasterizer, otherwise hardware rasterizer.

Cache key value. See isHardwareRasterizer(), getAvailableContextProperties(AbstractGraphicsDevice, GLProfile).

Definition at line 182 of file GLContext.java.

◆ CTX_IMPL_CACHE_MASK

final int com.jogamp.opengl.GLContext.CTX_IMPL_CACHE_MASK = 0x000003FF
staticprotected

Context option bits, cached bit mask covering 10 bits [0..9], i.e.

0x000003FF, {@value}. Leaving 6 bits for non cached options, i.e. 10:6.

Definition at line 167 of file GLContext.java.

◆ CTX_IMPL_ES2_COMPAT

final int com.jogamp.opengl.GLContext.CTX_IMPL_ES2_COMPAT = 1 << 10
staticprotected

GL_ARB_ES2_compatibility implementation related: Context is compatible w/ ES2.

Not a cache key. See isGLES2Compatible(), getAvailableContextProperties(AbstractGraphicsDevice, GLProfile).

Definition at line 189 of file GLContext.java.

◆ CTX_IMPL_ES31_COMPAT

final int com.jogamp.opengl.GLContext.CTX_IMPL_ES31_COMPAT = 1 << 12
staticprotected

GL_ARB_ES3_1_compatibility implementation related: Context is compatible w/ ES 3.1.

Not a cache key. See isGLES31Compatible(), getAvailableContextProperties(AbstractGraphicsDevice, GLProfile).

Definition at line 195 of file GLContext.java.

◆ CTX_IMPL_ES32_COMPAT

final int com.jogamp.opengl.GLContext.CTX_IMPL_ES32_COMPAT = 1 << 13
staticprotected

GL_ARB_ES3_2_compatibility implementation related: Context is compatible w/ ES 3.2.

Not a cache key. See isGLES32Compatible(), getAvailableContextProperties(AbstractGraphicsDevice, GLProfile).

Definition at line 198 of file GLContext.java.

◆ CTX_IMPL_ES3_COMPAT

final int com.jogamp.opengl.GLContext.CTX_IMPL_ES3_COMPAT = 1 << 11
staticprotected

GL_ARB_ES3_compatibility implementation related: Context is compatible w/ ES3.

Not a cache key. See isGLES3Compatible(), getAvailableContextProperties(AbstractGraphicsDevice, GLProfile).

Definition at line 192 of file GLContext.java.

◆ CTX_IMPL_FBO

final int com.jogamp.opengl.GLContext.CTX_IMPL_FBO = 1 << 14
staticprotected

Context supports basic FBO, details see hasBasicFBOSupport().

Not a cache key.

See also
hasBasicFBOSupport()
getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)

Definition at line 206 of file GLContext.java.

◆ CTX_IMPL_FP32_COMPAT_API

final int com.jogamp.opengl.GLContext.CTX_IMPL_FP32_COMPAT_API = 1 << 15
staticprotected

Context supports OES_single_precision, fp32, fixed function point (FFP) compatibility entry points, see hasFP32CompatAPI().

Not a cache key.

See also
hasFP32CompatAPI()
getAvailableContextProperties(AbstractGraphicsDevice, GLProfile)

Definition at line 215 of file GLContext.java.

◆ CTX_IMPL_FULL_MASK

final int com.jogamp.opengl.GLContext.CTX_IMPL_FULL_MASK = 0x0000FFFF
staticprotected

Context option bits, full bit mask covering 16 bits [0..15], i.e.

0x0000FFFF, {@value}.

Definition at line 164 of file GLContext.java.

◆ CTX_IS_ARB_CREATED

final int com.jogamp.opengl.GLContext.CTX_IS_ARB_CREATED = 1 << 0
staticprotected

ARB_create_context related: created via ARB_create_context.

Cache key value. See getAvailableContextProperties(AbstractGraphicsDevice, GLProfile).

Definition at line 170 of file GLContext.java.

◆ CTX_OPTION_DEBUG

final int com.jogamp.opengl.GLContext.CTX_OPTION_DEBUG = 1 << 5
static

◆ CTX_OPTION_FORWARD

final int com.jogamp.opengl.GLContext.CTX_OPTION_FORWARD = 1 << 4
staticprotected

ARB_create_context related: flag forward compatible.

Cache key value. See getAvailableContextProperties(AbstractGraphicsDevice, GLProfile).

Definition at line 178 of file GLContext.java.

◆ CTX_PROFILE_COMPAT

final int com.jogamp.opengl.GLContext.CTX_PROFILE_COMPAT = 1 << 1
staticprotected

ARB_create_context related: desktop compatibility profile.

Cache key value. See isGLCompatibilityProfile(), getAvailableContextProperties(AbstractGraphicsDevice, GLProfile).

Definition at line 172 of file GLContext.java.

◆ CTX_PROFILE_CORE

final int com.jogamp.opengl.GLContext.CTX_PROFILE_CORE = 1 << 2
staticprotected

ARB_create_context related: desktop core profile.

Cache key value. See isGLCoreProfile(), getAvailableContextProperties(AbstractGraphicsDevice, GLProfile).

Definition at line 174 of file GLContext.java.

◆ CTX_PROFILE_ES

final int com.jogamp.opengl.GLContext.CTX_PROFILE_ES = 1 << 3
staticprotected

ARB_create_context related: ES profile.

Cache key value. See isGLES(), getAvailableContextProperties(AbstractGraphicsDevice, GLProfile).

Definition at line 176 of file GLContext.java.

◆ ctxGLSLVersion

VersionNumber com.jogamp.opengl.GLContext.ctxGLSLVersion
protected

Definition at line 235 of file GLContext.java.

◆ ctxOptions

int com.jogamp.opengl.GLContext.ctxOptions
protected

Definition at line 232 of file GLContext.java.

◆ ctxVendorVersion

VersionNumberString com.jogamp.opengl.GLContext.ctxVendorVersion
protected

Definition at line 234 of file GLContext.java.

◆ ctxVersion

VersionNumber com.jogamp.opengl.GLContext.ctxVersion
protected

Definition at line 231 of file GLContext.java.

◆ ctxVersionString

String com.jogamp.opengl.GLContext.ctxVersionString
protected

Definition at line 233 of file GLContext.java.

◆ currentSwapGroup

int com.jogamp.opengl.GLContext.currentSwapGroup = -1
protected

Definition at line 1318 of file GLContext.java.

◆ DEBUG

final boolean com.jogamp.opengl.GLContext.DEBUG = Debug.debug("GLContext")
static

Definition at line 76 of file GLContext.java.

◆ DEBUG_GL

final boolean com.jogamp.opengl.GLContext.DEBUG_GL = Debug.isPropertyDefined("jogl.debug.DebugGL", true)
static

Reflects property jogl.debug.DebugGL.

If true, the debug pipeline is enabled at context creation.

Definition at line 107 of file GLContext.java.

◆ DEBUG_TRACE_SWITCH

final boolean com.jogamp.opengl.GLContext.DEBUG_TRACE_SWITCH = DEBUG || TRACE_SWITCH
static

Definition at line 78 of file GLContext.java.

◆ deviceVersionAvailable

final IdentityHashMap<String, Integer> com.jogamp.opengl.GLContext.deviceVersionAvailable = new IdentityHashMap<String, Integer>()
staticprotected

◆ drawableRetargeted

boolean com.jogamp.opengl.GLContext.drawableRetargeted
protected

Did the drawable association changed ? see GLRendererQuirks#NoSetSwapIntervalPostRetarget.

Definition at line 239 of file GLContext.java.

◆ ES_VERSIONS

final int com.jogamp.opengl.GLContext.ES_VERSIONS[][]
static
Initial value:
= {
{ -1 },
{ 0, 1 },
{ 0 },
{ 0, 1, 2 } }

Definition at line 1530 of file GLContext.java.

◆ GL_VERSIONS

final int com.jogamp.opengl.GLContext.GL_VERSIONS[][]
static
Initial value:
= {
{ -1 },
{ 0, 1, 2, 3, 4, 5 },
{ 0, 1 },
{ 0, 1, 2, 3 },
{ 0, 1, 2, 3, 4, 5, 6 } }

Definition at line 1523 of file GLContext.java.

◆ glRendererQuirks

GLRendererQuirks com.jogamp.opengl.GLContext.glRendererQuirks
protected

Definition at line 236 of file GLContext.java.

◆ lock

final RecursiveLock com.jogamp.opengl.GLContext.lock = LockFactory.createRecursiveLock()
protected

Definition at line 222 of file GLContext.java.

◆ PROFILE_ALIASING

final boolean com.jogamp.opengl.GLContext.PROFILE_ALIASING = !Debug.isPropertyDefined("jogl.debug.GLContext.NoProfileAliasing", true)
static

If true (default), bootstrapping the available GL profiles will use the highest compatible GL context for each profile, hence skipping querying lower profiles if a compatible higher one is found:

  • 4.2-core -> 4.2-core, 3.3-core
  • 4.2-comp -> 4.2-comp, 3.3-comp, 2

Otherwise the dedicated GL context would be queried and used:

  • 4.2-core -> 4.2-core
  • 3.3-core -> 3.3-core
  • 4.2-comp -> 4.2-comp
  • 3.3-comp -> 3.3-comp
  • 3.0-comp -> 2

Using aliasing speeds up initialization about:

  • Linux x86_64 - Nvidia: 28%, 700ms down to 500ms
  • Linux x86_64 - AMD : 40%, 1500ms down to 900ms

    Can be turned off with property jogl.debug.GLContext.NoProfileAliasing.

Definition at line 104 of file GLContext.java.

◆ TRACE_GL

final boolean com.jogamp.opengl.GLContext.TRACE_GL = Debug.isPropertyDefined("jogl.debug.TraceGL", true)
static

Reflects property jogl.debug.TraceGL.

If true, the trace pipeline is enabled at context creation.

Definition at line 109 of file GLContext.java.

◆ TRACE_SWITCH

final boolean com.jogamp.opengl.GLContext.TRACE_SWITCH = Debug.isPropertyDefined("jogl.debug.GLContext.TraceSwitch", true)
static

Definition at line 77 of file GLContext.java.

◆ Version1_0

final VersionNumber com.jogamp.opengl.GLContext.Version1_0 = new VersionNumber(1, 0, 0)
static

Version 1.00, i.e.

GLSL 1.00 for ES 2.0.

Definition at line 119 of file GLContext.java.

◆ Version1_1

final VersionNumber com.jogamp.opengl.GLContext.Version1_1 = new VersionNumber(1, 1, 0)
static

Version 1.1, i.e.

GL 1.1

Definition at line 132 of file GLContext.java.

◆ Version1_10

final VersionNumber com.jogamp.opengl.GLContext.Version1_10 = new VersionNumber(1, 10, 0)
static

Version 1.10, i.e.

GLSL 1.10 for GL 2.0.

Definition at line 121 of file GLContext.java.

◆ Version1_2

final VersionNumber com.jogamp.opengl.GLContext.Version1_2 = new VersionNumber(1, 2, 0)
static

Version 1.2, i.e.

GL 1.2

Definition at line 135 of file GLContext.java.

◆ Version1_20

final VersionNumber com.jogamp.opengl.GLContext.Version1_20 = new VersionNumber(1, 20, 0)
static

Version 1.20, i.e.

GLSL 1.20 for GL 2.1.

Definition at line 123 of file GLContext.java.

◆ Version1_30

final VersionNumber com.jogamp.opengl.GLContext.Version1_30 = new VersionNumber(1, 30, 0)
static

Version 1.30, i.e.

GLSL 1.30 for GL 3.0.

Definition at line 125 of file GLContext.java.

◆ Version1_4

final VersionNumber com.jogamp.opengl.GLContext.Version1_4 = new VersionNumber(1, 4, 0)
static

Version 1.4, i.e.

GL 1.4

Definition at line 138 of file GLContext.java.

◆ Version1_40

final VersionNumber com.jogamp.opengl.GLContext.Version1_40 = new VersionNumber(1, 40, 0)
static

Version 1.40, i.e.

GLSL 1.40 for GL 3.1.

Definition at line 127 of file GLContext.java.

◆ Version1_5

final VersionNumber com.jogamp.opengl.GLContext.Version1_5 = new VersionNumber(1, 5, 0)
static

Version 1.5, i.e.

GL 1.5

Definition at line 141 of file GLContext.java.

◆ Version1_50

final VersionNumber com.jogamp.opengl.GLContext.Version1_50 = new VersionNumber(1, 50, 0)
static

Version 1.50, i.e.

GLSL 1.50 for GL 3.2.

Definition at line 129 of file GLContext.java.

◆ Version3_0

final VersionNumber com.jogamp.opengl.GLContext.Version3_0 = new VersionNumber(3, 0, 0)
static

Version 3.0.

As an OpenGL version, it qualifies for desktop isGL2() only, or ES 3.0. Or GLSL 3.00 for ES 3.0.

Definition at line 144 of file GLContext.java.

◆ Version3_1

final VersionNumber com.jogamp.opengl.GLContext.Version3_1 = new VersionNumber(3, 1, 0)
static

Version 3.1.

As an OpenGL version, it qualifies for isGL3core(), isGL3bc() and isGL3()

Definition at line 147 of file GLContext.java.

◆ Version3_2

final VersionNumber com.jogamp.opengl.GLContext.Version3_2 = new VersionNumber(3, 2, 0)
static

Version 3.2.

As an OpenGL version, it qualifies for geometry shader

Definition at line 150 of file GLContext.java.

◆ Version4_3

final VersionNumber com.jogamp.opengl.GLContext.Version4_3 = new VersionNumber(4, 3, 0)
static

Version 4.3.

As an OpenGL version, it qualifies for GL_ARB_ES3_compatibility

Definition at line 153 of file GLContext.java.

◆ Version8_0

final VersionNumber com.jogamp.opengl.GLContext.Version8_0 = new VersionNumber(8, 0, 0)
staticprotected

Definition at line 155 of file GLContext.java.


The documentation for this class was generated from the following file: