38package com.jogamp.opengl;
40import java.nio.IntBuffer;
41import java.util.HashMap;
42import java.util.IdentityHashMap;
43import java.util.Iterator;
47import com.jogamp.common.os.DynamicLibraryBundle;
48import com.jogamp.common.os.Platform;
49import com.jogamp.common.util.Bitfield;
50import com.jogamp.common.util.VersionNumber;
51import com.jogamp.common.util.VersionNumberString;
52import com.jogamp.common.util.locks.LockFactory;
53import com.jogamp.common.util.locks.RecursiveLock;
54import com.jogamp.nativewindow.AbstractGraphicsDevice;
55import com.jogamp.nativewindow.NativeSurface;
57import jogamp.opengl.Debug;
58import jogamp.opengl.GLContextImpl;
59import jogamp.opengl.GLContextShareSet;
60import jogamp.opengl.GLDynamicLookupHelper;
76 public static final boolean DEBUG = Debug.debug(
"GLContext");
77 public static final boolean TRACE_SWITCH = Debug.isPropertyDefined(
"jogl.debug.GLContext.TraceSwitch",
true);
104 public static final boolean PROFILE_ALIASING = !Debug.isPropertyDefined(
"jogl.debug.GLContext.NoProfileAliasing",
true);
107 public static final boolean DEBUG_GL = Debug.isPropertyDefined(
"jogl.debug.DebugGL",
true);
109 public static final boolean TRACE_GL = Debug.isPropertyDefined(
"jogl.debug.TraceGL",
true);
119 public static final VersionNumber
Version1_0 =
new VersionNumber(1, 0, 0);
121 public static final VersionNumber
Version1_10 =
new VersionNumber(1, 10, 0);
123 public static final VersionNumber
Version1_20 =
new VersionNumber(1, 20, 0);
125 public static final VersionNumber
Version1_30 =
new VersionNumber(1, 30, 0);
127 public static final VersionNumber
Version1_40 =
new VersionNumber(1, 40, 0);
129 public static final VersionNumber
Version1_50 =
new VersionNumber(1, 50, 0);
132 public static final VersionNumber
Version1_1 =
new VersionNumber(1, 1, 0);
135 public static final VersionNumber
Version1_2 =
new VersionNumber(1, 2, 0);
138 public static final VersionNumber
Version1_4 =
new VersionNumber(1, 4, 0);
141 public static final VersionNumber
Version1_5 =
new VersionNumber(1, 5, 0);
144 public static final VersionNumber
Version3_0 =
new VersionNumber(3, 0, 0);
146 public static final VersionNumber
Version3_10 =
new VersionNumber(3, 10, 0);
148 public static final VersionNumber
Version3_20 =
new VersionNumber(3, 20, 0);
151 public static final VersionNumber
Version3_1 =
new VersionNumber(3, 1, 0);
154 public static final VersionNumber
Version3_2 =
new VersionNumber(3, 2, 0);
157 public static final VersionNumber
Version4_3 =
new VersionNumber(4, 3, 0);
159 protected static final VersionNumber
Version8_0 =
new VersionNumber(8, 0, 0);
161 private static final String S_EMPTY =
"";
221 private static final ThreadLocal<GLContext> currentContext =
new ThreadLocal<GLContext>();
223 private final HashMap<String, Object> attachedObjects =
new HashMap<String, Object>();
226 protected final RecursiveLock
lock = LockFactory.createRecursiveLock();
250 System.err.println(
getThreadName() +
": GLContext.resetStates(isInit "+isInit+
")");
258 attachedObjects.clear();
266 return GLContextShareSet.isShared(
this);
282 return GLContextShareSet.getCreatedShares(
this);
287 return GLContextShareSet.getDestroyedShares(
this);
520 return currentContext.get();
545 default:
return "INVALID_VALUE";
557 System.err.println(
getThreadName()+
": GLContext.ContextSwitch: - setCurrent() - NULL");
562 currentContext.set(cur);
616 return attachedObjects.get(name);
623 public final Object
attachObject(
final String name,
final Object obj) {
624 return attachedObjects.put(name, obj);
628 return attachedObjects.remove(name);
636 final StringBuilder sb =
new StringBuilder();
637 sb.append(getClass().getSimpleName());
641 return sb.toString();
644 public final StringBuilder
append(
final StringBuilder sb) {
646 sb.append(
"], options 0x");
648 sb.append(
", this ");
650 sb.append(
", handle ");
652 sb.append(
", isShared "+
isShared()+
", ");
654 sb.append(
",\n\t quirks: ");
661 sb.append(
",\n\tRead Drawable : ");
663 sb.append(
",\n\tWrite Drawable: ");
666 sb.append(
",\n\tDrawable: ");
828 public final VersionNumberString getGLSLVersionNumber() {
858 final String profileOpt;
866 throw new InternalError(
"Neither ES, Core nor Compat: "+
this);
868 return "#version " +
ctxGLSLVersion.getMajor() + ( minor < 10 ?
"0"+minor : minor ) + profileOpt +
"\n" ;
873 if( 3 == glMajorVersion ) {
874 switch ( glMinorVersion ) {
879 }
else if( 2 == glMajorVersion ) {
882 }
else if( 1 == glMajorVersion ) {
884 }
else if( 2 == glMajorVersion ) {
885 switch ( glMinorVersion ) {
889 }
else if( 3 == glMajorVersion && 2 >= glMinorVersion ) {
890 switch ( glMinorVersion ) {
898 final VersionNumber vn =
new VersionNumber(glMajorVersion, glMinorVersion * 10, 0);
899 return new VersionNumberString(vn, prefix+vn.toString());
901 private static final String glsl_prefix =
"OpenGL GLSL ";
902 private static final String glsl_es_prefix =
"OpenGL ES GLSL ES ";
1021 final int[] val =
new int[] { 0 } ;
1028 System.err.println(
"GLContext.getMaxRenderbufferSamples: GL_MAX_SAMPLES query GL Error 0x"+Integer.toHexString(glerr));
1030 }
catch (
final GLException gle) { gle.printStackTrace(); }
1285 throw new InternalError(
"Implemented in GLContextImpl");
1289 throw new InternalError(
"Implemented in GLContextImpl");
1306 throw new InternalError(
"Implemented in GLContextImpl");
1311 throw new InternalError(
"Implemented in GLContextImpl");
1315 final int[] maxBarriers,
final int maxBarriers_offset) {
1320 final int[] maxBarriers,
final int maxBarriers_offset) {
return false; }
1515 public abstract void glDebugMessageControl(
int source,
int type,
int severity,
int count, IntBuffer ids,
boolean enabled);
1522 public abstract void glDebugMessageControl(
int source,
int type,
int severity,
int count,
int[] ids,
int ids_offset,
boolean enabled);
1533 { 0, 1, 2, 3, 4, 5 },
1536 { 0, 1, 2, 3, 4, 5, 6 } };
1548 public static final int getMaxMinor(
final int ctxProfile,
final int major) {
1586 public static final boolean isValidGLVersion(
final int ctxProfile,
final int major,
final int minor) {
1587 if( 1>major || 0>minor ) {
1594 if( major >=
ES_VERSIONS.length + 1 )
return false;
1605 public static final boolean clipGLVersion(
final int ctxProfile,
final int major[],
final int minor[]) {
1606 final int m = major[0];
1607 final int n = minor[0];
1611 major[0] = ES_VERSIONS.length - 1;
1620 major[0] = GL_VERSIONS.length - 1;
1644 public static final boolean decrementGLVersion(
final int ctxProfile,
final int major[],
final int minor[]) {
1647 int n = minor[0] - 1;
1670 protected static int composeBits(
final int a8,
final int b8,
final int c16) {
1671 return ( ( a8 & 0x000000FF ) << 24 ) |
1672 ( ( b8 & 0x000000FF ) << 16 ) |
1673 ( ( c16 & 0x0000FFFF ) ) ;
1675 protected static VersionNumber
decomposeBits(
final int bits32,
final int[] ctp) {
1676 final int major = ( bits32 & 0xFF000000 ) >>> 24 ;
1677 final int minor = ( bits32 & 0x00FF0000 ) >>> 16 ;
1678 ctp[0] = ( bits32 & 0x0000FFFF ) ;
1679 return new VersionNumber(major, minor, 0);
1682 return ( bits32 & 0x0000FFFF );
1691 throw new GLException(
"Internal Error: "+argName+
": 1 != num-profiles: "+num);
1707 private static final IdentityHashMap<String, String> deviceVersionsAvailableSet =
new IdentityHashMap<String, String>();
1712 deviceVersionsAvailableSet.clear();
1713 GLContextImpl.shutdownImpl();
1717 synchronized ( deviceVersionsAvailableSet ) {
1718 return deviceVersionsAvailableSet.containsKey(device.
getUniqueID());
1723 synchronized ( deviceVersionsAvailableSet ) {
1726 deviceVersionsAvailableSet.put(devKey, devKey);
1728 deviceVersionsAvailableSet.remove(devKey);
1731 System.err.println(
getThreadName() +
": createContextARB-MapGLVersions SET "+devKey);
1748 sb =
new StringBuilder();
1752 boolean needsSeparator =
false;
1753 for(
final Iterator<String> keyI = keys.iterator(); keyI.hasNext(); ) {
1754 if(needsSeparator) {
1755 sb.append(Platform.getNewline());
1757 final String key = keyI.next();
1758 sb.append(
"MapGLVersions ").append(key).append(
": ");
1761 final int[] ctp = { 0 };
1762 final VersionNumber version =
decomposeBits(valI.intValue(), ctp);
1767 needsSeparator =
true;
1796 final int[] major,
final int minor[],
final int ctp[]) {
1803 final int bits32 = valI.intValue();
1806 major[0] = ( bits32 & 0xFF000000 ) >>> 24 ;
1809 minor[0] = ( bits32 & 0x00FF0000 ) >>> 16 ;
1812 ctp[0] = ( bits32 & 0x0000FFFF ) ;
1821 protected static String
getGLProfile(
final int major,
final int minor,
final int ctp)
1829 else if(major == 3 && minor >= 1) {
return GLProfile.
GL3; }
1843 if( glpImpl.
isGL4() ) {
1847 }
else if (glpImpl.
isGLES1()) {
1854 }
else if( glpImpl.
isGL2() ) {
1867 final int[] reqMajorCTP =
new int[] { 0, 0 };
1870 final int _major[] = { 0 };
1871 final int _minor[] = { 0 };
1872 final int _ctp[] = { 0 };
1887 final String glpName = getAvailableGLProfileName(device, reqMajor, reqProfile);
1888 return null != glpName ?
GLProfile.
get(device, glpName) :
null;
1897 static String getAvailableGLProfileName(
final AbstractGraphicsDevice device,
final int reqMajor,
final int reqProfile)
1899 final int major[] = { 0 };
1900 final int minor[] = { 0 };
1901 final int ctp[] = { 0 };
1902 if(
GLContext.getAvailableGLVersion(device, reqMajor, reqProfile, major, minor, ctp)) {
1903 return GLContext.getGLProfile(major[0], minor[0], ctp[0]);
1914 final int _major[] = { 0 };
1915 final int _minor[] = { 0 };
1916 final int _ctp[] = { 0 };
1918 return getGLVersion(_major[0], _minor[0], _ctp[0],
null);
1970 isHardware[0] = 0 == ( valI.intValue() & GLContext.CTX_IMPL_ACCEL_SOFT ) ;
1987 final int major[] = { 0 };
1988 final int minor[] = { 0 };
1989 final int ctp[] = { 0 };
1992 ok =
GLContext.getAvailableGLVersion(device, 3,
GLContext.CTX_PROFILE_ES, major, minor, ctp);
1994 ok =
GLContext.getAvailableGLVersion(device, 3,
GLContext.CTX_PROFILE_CORE, major, minor, ctp);
1997 GLContext.getAvailableGLVersion(device, 3,
GLContext.CTX_PROFILE_COMPAT, major, minor, ctp);
2056 protected static StringBuilder
getGLProfile(
final StringBuilder sb,
final int ctp) {
2057 boolean needColon =
false;
2058 needColon = appendString(sb,
"ES profile", needColon, 0 != (
CTX_PROFILE_ES & ctp ));
2059 needColon = appendString(sb,
"Compat profile", needColon, 0 != (
CTX_PROFILE_COMPAT & ctp ));
2060 needColon = appendString(sb,
"Core profile", needColon, 0 != (
CTX_PROFILE_CORE & ctp ));
2061 needColon = appendString(sb,
"forward", needColon, 0 != (
CTX_OPTION_FORWARD & ctp ));
2063 needColon = appendString(sb,
"debug", needColon, 0 != (
CTX_OPTION_DEBUG & ctp ));
2064 needColon = appendString(sb,
"compat[", needColon,
true);
2074 needColon = appendString(sb,
"]", needColon,
true);
2075 needColon = appendString(sb,
"FBO", needColon, 0 != (
CTX_IMPL_FBO & ctp ));
2077 needColon = appendString(sb,
"software", needColon,
true);
2079 needColon = appendString(sb,
"hardware", needColon,
true);
2083 protected static StringBuilder
getGLVersion(
final StringBuilder sb,
final VersionNumber version,
final int ctp,
final String gl_version) {
2084 return getGLVersion(sb, version.getMajor(), version.getMinor(), ctp, gl_version);
2086 protected static StringBuilder
getGLVersion(
final StringBuilder sb,
final int major,
final int minor,
final int ctp,
final String gl_version) {
2093 if(
null!=gl_version) {
2095 sb.append(gl_version);
2099 protected static String
getGLVersion(
final int major,
final int minor,
final int ctp,
final String gl_version) {
2100 return getGLVersion(
new StringBuilder(), major, minor, ctp, gl_version).toString();
2108 return "0x" + Integer.toHexString(hex);
2112 return "0x" + Long.toHexString(hex);
2115 private static boolean appendString(
final StringBuilder sb,
final String
string,
boolean needColon,
final boolean condition) {
2126 protected static String
getThreadName() {
return Thread.currentThread().getName(); }
Abstraction for an OpenGL rendering context.
final boolean isShared()
Returns true if this GLContext is shared, otherwise false.
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.
abstract void copy(GLContext source, int mask)
Copies selected groups of OpenGL state variables from the supplied source context into this one.
final boolean isGLES()
Indicates whether this GLContext is capable of GLES.
boolean bindSwapBarrierImpl(final int group, final int barrier)
final boolean isGLES31Compatible()
Return true if this context is an ES3 context ≥ 3.1 or implements the extension GL_ARB_ES3_1_compatib...
final boolean isGLForwardCompatible()
void setDefaultSwapInterval()
static final boolean isGLES3CompatibleAvailable(final AbstractGraphicsDevice device)
Returns true if a ES3 compatible profile is available, i.e.
abstract int getBoundFramebuffer(int target)
Return the framebuffer name bound to this context, see GL#glBindFramebuffer(int, int).
static final int CTX_IMPL_FP32_COMPAT_API
Context supports OES_single_precision, fp32, fixed function point (FFP) compatibility entry points,...
final StringBuilder append(final StringBuilder sb)
static final VersionNumber Version4_3
Version 4.3.
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 ...
abstract GLDrawable getGLDrawable()
Returns the write-drawable this context uses for framebuffer operations.
abstract void setContextCreationFlags(int flags)
VersionNumberString ctxVersion
static final int CONTEXT_NOT_CURRENT
Indicates that the context was not made current during the last call to makeCurrent,...
final boolean isGL2()
Indicates whether this GLContext is capable of GL2.
boolean queryMaxSwapGroupsImpl(final int[] maxGroups, final int maxGroups_offset, final int[] maxBarriers, final int maxBarriers_offset)
static final VersionNumber Version1_0
Version 1.00, i.e.
abstract int getDefaultReadBuffer()
Returns the default color buffer within the current bound getDefaultReadFramebuffer(),...
final boolean isGLDebugEnabled()
static final int CTX_IMPL_ES2_COMPAT
GL_ARB_ES2_compatibility implementation related: Context is compatible w/ ES2.
static GLContext getCurrent()
Returns this thread current context.
static final int CTX_IMPL_CACHE_MASK
Context option bits, cached bit mask covering 10 bits [0..9], i.e.
static GLProfile getAvailableGLProfile(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile)
final boolean isGL4bc()
Indicates whether this GLContext is capable of GL4bc.
static StringBuilder dumpAvailableGLVersions(StringBuilder sb)
static String toHexString(final int hex)
abstract int makeCurrent()
Makes this GLContext current on the calling thread.
static final VersionNumber Version1_10
Version 1.10, i.e.
static final boolean isGLES31CompatibleAvailable(final AbstractGraphicsDevice device)
Returns true if a ES3 ≥ 3.1 compatible profile is available, i.e.
final boolean isCreated()
Indicates whether the underlying native OpenGL context has been created.
boolean isTextureFormatBGRA8888Available()
final String getGLSLVersionString()
Returns the matching GLSL version number, queried by this context GL via GL2ES2#GL_SHADING_LANGUAGE_V...
static void validateProfileBits(final int bits, final String argName)
static int composeBits(final int a8, final int b8, final int c16)
abstract boolean isGLDebugMessageEnabled()
abstract boolean isGLDebugSynchronous()
VersionNumberString ctxVendorVersion
final boolean hasFullFBOSupport()
Returns true if full FBO support is available, otherwise false.
static final boolean DEBUG_TRACE_SWITCH
static final int getAvailableContextProperties(final AbstractGraphicsDevice device, final GLProfile glp)
abstract int getDefaultDrawFramebuffer()
Return the default draw framebuffer name.
static final int CONTEXT_CURRENT
Indicates that the context was made current during the last call to makeCurrent, value {@value}.
static boolean isGL3Available(final AbstractGraphicsDevice device, final boolean isHardware[])
static StringBuilder getGLProfile(final StringBuilder sb, final int ctp)
static final VersionNumber Version1_30
Version 1.30, i.e.
static String getGLProfile(final int major, final int minor, final int ctp)
returns the highest GLProfile string regarding the implementation version and context profile bits.
final boolean joinSwapGroup(final int group)
static final int CTX_PROFILE_COMPAT
ARB_create_context related: desktop compatibility profile.
final boolean isGL2GL3()
Indicates whether this GLContext is capable of GL2GL3.
final int getMaxRenderbufferSamples()
Returns the maximum number of FBO RENDERBUFFER samples if full FBO is supported, otherwise false.
final boolean isGLES32Compatible()
Return true if this context is an ES3 context ≥ 3.2 or implements the extension GL_ARB_ES3_2_compatib...
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.
static Integer getAvailableGLVersion(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile)
abstract void addGLDebugListener(GLDebugListener listener)
Add GLDebugListener.
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 ...
abstract GL setGL(GL gl)
Sets the GL pipeline object for this GLContext.
final GLContext getSharedMaster()
Returns the shared master GLContext of this GLContext if shared, otherwise return null.
final List< GLContext > getDestroyedShares()
Returns a new list of destroyed GLContext shared with this GLContext.
static boolean isGLES2Available(final AbstractGraphicsDevice device, final boolean isHardware[])
final boolean isGL4core()
Indicates whether this GLContext uses a GL4 core profile.
final boolean isGL3()
Indicates whether this GLContext is capable of GL3.
static final VersionNumber Version1_20
Version 1.20, i.e.
static final boolean DEBUG_GL
Reflects property jogl.debug.DebugGL.
boolean isNPOTTextureAvailable()
Note: The GL impl.
static boolean isGLVersionAvailable(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile, final boolean isHardware[])
final boolean isCreatedWithARBMethod()
final boolean isGL2ES2()
Indicates whether this GLContext is capable of GL2ES2.
static final String makeCurrentResultToString(final int res)
Returns a String representation of the makeCurrent() result.
static final VersionNumber Version1_2
Version 1.2, i.e.
static final VersionNumber Version1_50
Version 1.50, i.e.
abstract int getDefaultPixelDataFormat()
Get the default pixel data format, as required by e.g.
abstract int getDefaultDrawBuffer()
Returns the default color buffer within the current bound getDefaultReadFramebuffer(),...
final boolean isGLES3Compatible()
Return true if this context is an ES3 context or implements the extension GL_ARB_ES3_compatibility,...
static boolean isGL4bcAvailable(final AbstractGraphicsDevice device, final boolean isHardware[])
abstract void setGLDebugSynchronous(boolean synchronous)
Enables or disables the synchronous debug behavior via glEnable/glDisable(GL_DEBUG_OUTPUT_SYNCHRONOUS...
static boolean getAvailableGLVersionsSet(final AbstractGraphicsDevice device)
static final int CTX_IMPL_ES31_COMPAT
GL_ARB_ES3_1_compatibility implementation related: Context is compatible w/ ES 3.1.
static boolean isGL3bcAvailable(final AbstractGraphicsDevice device, final boolean isHardware[])
static final VersionNumber Version1_40
Version 1.40, i.e.
final boolean hasBasicFBOSupport()
Returns true if basic FBO support is available, otherwise false.
static final VersionNumber Version3_20
Version 3.20.
final Object getAttachedObject(final String name)
Returns the attached user object for the given name to this GLContext.
abstract void release()
Releases control of this GLContext from the current thread.
boolean joinSwapGroupImpl(final int group)
abstract boolean isFunctionAvailable(String glFunctionName)
Returns true if the specified OpenGL core- or extension-function can be successfully called using thi...
static final VersionNumber Version8_0
final boolean isGLCoreProfile()
static String toHexString(final long hex)
static final VersionNumber Version3_0
Version 3.0.
static final int getMaxMajor(final int ctxProfile)
abstract void enableGLDebugMessage(boolean enable)
Enables or disables the GLDebugOutput feature of extension GLExtensions#ARB_debug_output or GLExtensi...
static final int GL_VERSIONS[][]
abstract DynamicLibraryBundle getDynamicLibraryBundle()
Returns the DynamicLibraryBundle, matching context.
abstract String getGLExtensionsString()
Returns a non-null (but possibly empty) string containing the space-separated list of available exten...
static final boolean DEBUG
boolean setSwapInterval(final int interval)
Set the swap interval of the current context and attached onscreen GLDrawable.
static final int CTX_IMPL_FBO
Context supports basic FBO, details see hasBasicFBOSupport().
final Object detachObject(final String name)
final boolean bindSwapBarrier(final int group, final int barrier)
static final int isHardwareRasterizer(final AbstractGraphicsDevice device, final GLProfile glp)
static final int CTX_OPTION_FORWARD
ARB_create_context related: flag forward compatible.
final boolean isGLESProfile()
final boolean hasRendererQuirk(final int quirk)
Returns true if the quirk exist in getRendererQuirks(), otherwise false.
boolean setSwapIntervalImpl(final int interval)
void resetStates(final boolean isInit)
final VersionNumberString getGLVersionNumber()
Returns this context OpenGL version.
boolean drawableRetargeted
Did the drawable association changed ? see GLRendererQuirks#NoSetSwapIntervalPostRetarget.
final Object attachObject(final String name, final Object obj)
Sets the attached user object for the given name to this GLContext.
static String getAvailableGLVersionAsString(final AbstractGraphicsDevice device, final int major, final int profile)
abstract void destroy()
Destroys this OpenGL context and frees its associated resources.
static final VersionNumber Version1_1
Version 1.1, i.e.
abstract void removeGLDebugListener(GLDebugListener listener)
Remove GLDebugListener.
final List< GLContext > getCreatedShares()
Returns a new list of created GLContext shared with this GLContext.
static final VersionNumber Version3_2
Version 3.2.
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#glD...
static final VersionNumber Version1_5
Version 1.5, i.e.
final boolean isGL3ES3()
Indicates whether this GLContext is capable of GL3ES3.
final boolean isGLES2()
Indicates whether this GLContext is capable of GLES2.
final void validateCurrent()
static boolean getAvailableGLVersion(final AbstractGraphicsDevice device, final int reqMajor, final int reqProfile, final int[] major, final int minor[], final int ctp[])
abstract GL getRootGL()
Returns the implementing root GL instance of this GLContext's GL object, considering a wrapped pipeli...
final boolean hasFP32CompatAPI()
Returns true if OES_single_precision, fp32, fixed function point (FFP) compatibility entry points ava...
String toString()
Classname, GL, GLDrawable.
final boolean isGL2ES3()
Indicates whether this GLContext is capable of GL2ES3.
static final int getMaxMinor(final int ctxProfile, final int major)
static final boolean isGLES32CompatibleAvailable(final AbstractGraphicsDevice device)
Returns true if a ES3 ≥ 3.2 compatible profile is available, i.e.
static String getGLVersion(final int major, final int minor, final int ctp, final String gl_version)
static boolean isGL4Available(final AbstractGraphicsDevice device, final boolean isHardware[])
static final int CTX_IMPL_FULL_MASK
Context option bits, full bit mask covering 16 bits [0..15], i.e.
final boolean isCPUDataSourcingAvail()
Indicates whether this GLContext allows CPU data sourcing (indices, vertices ..) as opposed to using ...
static void setCurrent(final GLContext cur)
Sets the thread-local variable returned by getCurrent and has no other side-effects.
final boolean isGLES3()
Indicates whether this GLContext is capable of GLES3.
abstract String getGLDebugMessageExtension()
final GLRendererQuirks getRendererQuirks()
Returns the instance of GLRendererQuirks, allowing one to determine workarounds.
static final int CTX_IMPL_ES3_COMPAT
GL_ARB_ES3_compatibility implementation related: Context is compatible w/ ES3.
static boolean isGLES3Available(final AbstractGraphicsDevice device, final boolean isHardware[])
static final boolean isFBOAvailable(final AbstractGraphicsDevice device, final GLProfile glp)
Returns true if it is possible to create an framebuffer object (FBO).
static boolean isGL2Available(final AbstractGraphicsDevice device, final boolean isHardware[])
abstract int getDefaultPixelDataType()
Get the default pixel data type, as required by e.g.
static final int CTX_OPTION_DEBUG
ARB_create_context related: flag debug.
final boolean isGL3core()
Indicates whether this GLContext uses a GL3 core profile.
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 req...
static final VersionNumberString getStaticGLSLVersionNumber(final int glMajorVersion, final int glMinorVersion, final int ctxOptions)
abstract int getContextCreationFlags()
abstract GL getGL()
Returns the GL pipeline object for this GLContext.
static final VersionNumber Version3_1
Version 3.1.
static final VersionNumber Version1_4
Version 1.4, i.e.
static final IdentityHashMap< String, Integer > deviceVersionAvailable
final VersionNumberString getGLVendorVersionNumber()
Returns the vendor's version, i.e.
static boolean isGLES1Available(final AbstractGraphicsDevice device, final boolean isHardware[])
static void setAvailableGLVersionsSet(final AbstractGraphicsDevice device, final boolean set)
static void shutdown()
clears the device/context mappings as well as the GL/GLX proc address tables.
final boolean hasNoDefaultVAO()
Indicates whether this GLContext's native profile does not implement a default vertex array object (V...
VersionNumberString ctxGLSLVersion
abstract GLDrawable setGLReadDrawable(GLDrawable read)
Set the read-Drawable for read framebuffer operations.
int getSwapInterval()
Return the current swap interval.
static final int CTX_PROFILE_ES
ARB_create_context related: ES profile.
static final boolean TRACE_GL
Reflects property jogl.debug.TraceGL.
final boolean isGLES2Compatible()
static final int CTX_IS_ARB_CREATED
ARB_create_context related: created via ARB_create_context.
static final int CTX_IMPL_ES32_COMPAT
GL_ARB_ES3_2_compatibility implementation related: Context is compatible w/ ES 3.2.
static final int CONTEXT_CURRENT_NEW
Indicates that a newly-created context was made current during the last call to makeCurrent,...
final boolean isGL2ES1()
Indicates whether this GLContext is capable of GL2ES1.
final long getHandle()
Returns the underlying native OpenGL context handle.
static GL getCurrentGL()
Returns the GL object bound to this thread current context.
abstract String getPlatformExtensionsString()
Returns a non-null (but possibly empty) string containing the space-separated list of available platf...
final boolean isGLcore()
Indicates whether this GLContext uses a GL core profile.
final boolean isGLES1()
Indicates whether this GLContext is capable of GLES1.
abstract GLDrawable setGLDrawable(GLDrawable readWrite, boolean setWriteOnly)
Sets the read/write drawable for framebuffer operations, i.e.
volatile long contextHandle
The underlying native OpenGL context.
final String getGLVersion()
Returns a valid OpenGL version string, ie
static final int CTX_PROFILE_CORE
ARB_create_context related: desktop core profile.
final boolean isGL4()
Indicates whether this GLContext is capable of GL4.
abstract boolean isExtensionAvailable(String glExtensionName)
Returns true if the specified OpenGL extension can be successfully called using this GL context given...
final boolean isGL3bc()
Indicates whether this GLContext is capable of GL3bc.
final boolean isGLCompatibilityProfile()
abstract int getDefaultVAO()
If this GLContext does not implement a default VAO, see hasNoDefaultVAO(), an own default VAO will be...
static StringBuilder getGLVersion(final StringBuilder sb, final int major, final int minor, final int ctp, final String gl_version)
static StringBuilder getGLVersion(final StringBuilder sb, final VersionNumber version, final int ctp, final String gl_version)
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#gl...
static final boolean TRACE_SWITCH
static int getCTPFromBits(final int bits32)
final boolean isGL4ES3()
Returns true if this profile is capable of GL4ES3, i.e.
abstract int getGLExtensionCount()
Returns the number of OpenGL extensions.
static final VersionNumber Version3_10
Version 3.10.
static final int ES_VERSIONS[][]
final boolean isHardwareRasterizer()
final boolean queryMaxSwapGroups(final int[] maxGroups, final int maxGroups_offset, final int[] maxBarriers, final int maxBarriers_offset)
abstract GLDrawable getGLReadDrawable()
Returns the read-Drawable this context uses for read framebuffer operations.
static VersionNumber decomposeBits(final int bits32, final int[] ctp)
static final boolean PROFILE_ALIASING
If true (default), bootstrapping the available GL profiles will use the highest compatible GL context...
GLRendererQuirks glRendererQuirks
final boolean isCurrent()
abstract boolean isGLReadDrawableAvailable()
Query whether using a distinguished read-drawable is supported.
abstract int getPlatformExtensionCount()
Returns the number of platform extensions.
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#glDebugMess...
static final int CTX_IMPL_ACCEL_SOFT
Context uses software rasterizer, otherwise hardware rasterizer.
abstract int getDefaultReadFramebuffer()
Return the default read framebuffer name.
static String getThreadName()
A generic exception for OpenGL errors used throughout the binding as a substitute for RuntimeExceptio...
Class holding OpenGL extension strings, commonly used by JOGL's implementation.
static final String ARB_framebuffer_object
static final String ARB_texture_non_power_of_two
static final String EXT_texture_format_BGRA8888
static final String EXT_packed_depth_stencil
static final String IMG_texture_format_BGRA8888
static final String EXT_framebuffer_object
static final String EXT_framebuffer_blit
static final String EXT_framebuffer_multisample
Specifies the the OpenGL profile.
final boolean isGLES3()
Indicates whether this profile is capable of GLES3.
static final String GLES3
The embedded OpenGL profile ES 3.x, with x >= 0.
static final String GL3
The desktop OpenGL core profile 3.x, with x >= 1.
static final String GLES2
The embedded OpenGL profile ES 2.x, with x >= 0.
final GLProfile getImpl()
return this profiles implementation, eg.
static final String GL4bc
The desktop OpenGL compatibility profile 4.x, with x >= 0, ie GL2 plus GL4.
final boolean isGLES1()
Indicates whether this profile is capable of GLES1.
final boolean isGL4()
Indicates whether this profile is capable of GL4.
final boolean isGLES()
Indicates whether this profile is capable of GLES.
static GLProfile get(final AbstractGraphicsDevice device, String profile)
Returns a GLProfile object.
static final String GL3bc
The desktop OpenGL compatibility profile 3.x, with x >= 1, ie GL2 plus GL3.
static final String GL2
The desktop OpenGL profile 1.x up to 3.0.
static final String GLES1
The embedded OpenGL profile ES 1.x, with x >= 0.
static final String GL4
The desktop OpenGL core profile 4.x, with x >= 0.
final boolean isGL3()
Indicates whether this profile is capable of GL3.
final boolean isGL2()
Indicates whether this profile is capable of GL2 .
GLRendererQuirks contains information of known bugs of various GL renderer.
final boolean exist(final int quirkBit)
Method tests whether the given quirk exists.
static final int NoFullFBOSupport
No full FBO support, i.e.
final StringBuilder toString(StringBuilder sb)
A interface describing a graphics device in a toolkit-independent manner.
String getUniqueID()
Returns a unique ID object of this device using type, connection and unitID as it's key components.
Listener for GLDebugMessages.
An abstraction for an OpenGL rendering target.
void glGetIntegerv(int pname, IntBuffer data)
Entry point to C language function: void {@native glGetIntegerv}(GLenum pname, GLint * data) Part ...
static final int GL_NO_ERROR
GL_ES_VERSION_2_0, GL_VERSION_1_0, GL_VERSION_ES_1_0 Define "GL_NO_ERROR" with expression '0',...
int glGetError()
Entry point to C language function: GLenum {@native glGetError}() Part of GL_ES_VERSION_2_0,...
static final int GL_MAX_SAMPLES
GL_ES_VERSION_3_0, GL_ARB_framebuffer_object, GL_VERSION_3_0, GL_NV_framebuffer_multisample,...