protected static String getGLVersion(final int major, final int minor, final int ctp, final String gl_version) { return GLContext.getGLVersion(major, minor, ctp, gl_version); }
public final StringBuilder append(final StringBuilder sb) { sb.append("Version ").append(getGLVersion()).append(" [GL ").append(getGLVersionNumber()).append(", vendor ").append(getGLVendorVersionNumber()); sb.append("], options 0x"); sb.append(Integer.toHexString(ctxOptions)); sb.append(", this "); sb.append(toHexString(hashCode())); sb.append(", handle "); sb.append(toHexString(contextHandle)); sb.append(", isShared "+isShared()+", "); sb.append(getGL()); sb.append(",\n\t quirks: "); if(null != glRendererQuirks) { glRendererQuirks.toString(sb); } else { sb.append("n/a"); } if(getGLDrawable()!=getGLReadDrawable()) { sb.append(",\n\tRead Drawable : "); sb.append(getGLReadDrawable()); sb.append(",\n\tWrite Drawable: "); sb.append(getGLDrawable()); } else { sb.append(",\n\tDrawable: "); sb.append(getGLDrawable()); } return sb; }
/** * @param device the device the profile is being requested * @param major Key Value either 1, 2, 3 or 4 * @param profile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES} */ protected static String getAvailableGLVersionAsString(final AbstractGraphicsDevice device, final int major, final int profile) { final int _major[] = { 0 }; final int _minor[] = { 0 }; final int _ctp[] = { 0 }; if(getAvailableGLVersion(device, major, profile, _major, _minor, _ctp)) { return getGLVersion(_major[0], _minor[0], _ctp[0], null); } return null; }
sb.append("GL Profile ").append(gl.getGLProfile()); sb.append(Platform.getNewline()); sb.append("GL Version ").append(ctx.getGLVersion()).append(" [GL ").append(ctx.getGLVersionNumber()).append(", vendor ").append(ctx.getGLVendorVersionNumber()).append("]"); sb.append(Platform.getNewline()); sb.append("Quirks ").append(ctx.getRendererQuirks());
/** * returns the highest GLProfile string regarding the implementation version and context profile bits. * @throws GLException if version and context profile bits could not be mapped to a GLProfile */ protected static String getGLProfile(final int major, final int minor, final int ctp) throws GLException { if(0 != ( CTX_PROFILE_COMPAT & ctp )) { if(major >= 4) { return GLProfile.GL4bc; } else if(major == 3 && minor >= 1) { return GLProfile.GL3bc; } else { return GLProfile.GL2; } } else if(0 != ( CTX_PROFILE_CORE & ctp )) { if(major >= 4) { return GLProfile.GL4; } else if(major == 3 && minor >= 1) { return GLProfile.GL3; } } else if(0 != ( CTX_PROFILE_ES & ctp )) { if(major == 3) { return GLProfile.GLES3; } else if(major == 2) { return GLProfile.GLES2; } else if(major == 1) { return GLProfile.GLES1; } } throw new GLException("Unhandled OpenGL version/profile: "+GLContext.getGLVersion(major, minor, ctp, null)); }
public StringBuilder toString(StringBuilder sb) { final String crtab = Platform.getNewline()+"\t"; if(null==sb) { sb = new StringBuilder(); } sb.append("GLDebugEvent[ id "); toHexString(sb, dbgId) .append(crtab).append("type ").append(getDbgTypeString(dbgType)) .append(crtab).append("severity ").append(getDbgSeverityString(dbgSeverity)) .append(crtab).append("source ").append(getDbgSourceString(dbgSource)) .append(crtab).append("msg ").append(dbgMsg) .append(crtab).append("when ").append(when); if(null != source) { sb.append(crtab).append("source ").append(source.getGLVersion()).append(" - hash 0x").append(Integer.toHexString(source.hashCode())); } sb.append("]"); return sb; }
protected static StringBuilder dumpAvailableGLVersions(StringBuilder sb) { if(null == sb) { sb = new StringBuilder(); } synchronized(deviceVersionAvailable) { final Set<String> keys = deviceVersionAvailable.keySet(); boolean needsSeparator = false; for(final Iterator<String> i = keys.iterator(); i.hasNext(); ) { if(needsSeparator) { sb.append(Platform.getNewline()); } final String key = i.next(); sb.append(key).append(": "); final Integer valI = deviceVersionAvailable.get(key); if(null != valI) { final int bits32 = valI.intValue(); final int major = ( bits32 & 0xFF000000 ) >>> 24 ; final int minor = ( bits32 & 0x00FF0000 ) >>> 16 ; final int ctp = ( bits32 & 0x0000FFFF ) ; sb.append(GLContext.getGLVersion(major, minor, ctp, null)); } else { sb.append("n/a"); } needsSeparator = true; } } return sb; }
/** * Called by {@link jogamp.opengl.GLContextImpl#createContextARBMapVersionsAvailable(int,int)} not intended to be used by * implementations. However, if {@link jogamp.opengl.GLContextImpl#createContextARB(long, boolean)} is not being used within * {@link javax.media.opengl.GLDrawableFactory#getOrCreateSharedContext(javax.media.nativewindow.AbstractGraphicsDevice)}, * GLProfile has to map the available versions. * * @param reqMajor Key Value either 1, 2, 3 or 4 * @param profile Key Value either {@link #CTX_PROFILE_COMPAT}, {@link #CTX_PROFILE_CORE} or {@link #CTX_PROFILE_ES} * @return the old mapped value * * @see #createContextARBMapVersionsAvailable */ protected static Integer mapAvailableGLVersion(final AbstractGraphicsDevice device, final int reqMajor, final int profile, final int resMajor, final int resMinor, int resCtp) { validateProfileBits(profile, "profile"); validateProfileBits(resCtp, "resCtp"); if(FORCE_NO_FBO_SUPPORT) { resCtp &= ~CTX_IMPL_FBO ; } if(DEBUG) { System.err.println("GLContext.mapAvailableGLVersion: "+device+": "+getGLVersion(reqMajor, 0, profile, null)+" -> "+getGLVersion(resMajor, resMinor, resCtp, null)); // Thread.dumpStack(); } final String objectKey = getDeviceVersionAvailableKey(device, reqMajor, profile); final Integer val = Integer.valueOf(composeBits(resMajor, resMinor, resCtp)); synchronized(deviceVersionAvailable) { return deviceVersionAvailable.put( objectKey, val ); } }
/* pp */ final void validateGL(final GL gl) throws GLException { if( imageBuffer != null && !gl.isGL2ES3()) { throw new GLException("Using image-buffer w/ inssufficient GL context: "+gl.getContext().getGLVersion()+", "+gl.getGLProfile()); } }
private final void removeCachedVersion(final int major, final int minor, int ctxProfileBits) { if(!isCurrentContextHardwareRasterizer()) { ctxProfileBits |= GLContext.CTX_IMPL_ACCEL_SOFT; } final AbstractGraphicsConfiguration aconfig = drawable.getNativeSurface().getGraphicsConfiguration(); final AbstractGraphicsDevice adevice = aconfig.getScreen().getDevice(); contextFQN = getContextFQN(adevice, major, minor, ctxProfileBits); if (DEBUG) { System.err.println(getThreadName() + ": RM Context FQN: "+contextFQN+" - "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)); } synchronized(mappedContextTypeObjectLock) { final ProcAddressTable table = mappedGLProcAddress.remove( contextFQN ); if(DEBUG) { final int hc = null != table ? table.hashCode() : 0; System.err.println(getThreadName() + ": RM GLContext GL ProcAddressTable mapping key("+contextFQN+") -> "+toHexString(hc)); } } synchronized(mappedContextTypeObjectLock) { final ExtensionAvailabilityCache eCache = mappedExtensionAvailabilityCache.remove( contextFQN ); if(DEBUG) { final int hc = null != eCache ? eCache.hashCode() : 0; System.err.println(getThreadName() + ": RM GLContext GL ExtensionAvailabilityCache mapping key("+contextFQN+") -> "+toHexString(hc)); } } }
System.err.println(getThreadName() + ": createContextARB: Requested "+GLContext.getGLVersion(reqMajorCTP[0], 0, reqMajorCTP[0], null)); _ctp[0] |= additionalCtxCreationFlags; if(DEBUG) { System.err.println(getThreadName() + ": createContextARB: Mapped "+GLContext.getGLVersion(_major[0], _minor[0], _ctp[0], null));
System.err.println("packedDepthStencil: "+packedDepthStencilAvail); System.err.println("NV_fbo_color_attachments: "+NV_fbo_color_attachments); System.err.println(gl.getContext().getGLVersion()); System.err.println(JoglVersion.getGLStrings(gl, null, false).toString());
throw new GLException("Invalid GL Version Request "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)); final String errMsg = "Intialization of GL renderer strings failed. "+adevice+" - "+GLContext.getGLVersion(major, minor, ctxProfileBits, null); if( strictMatch ) { if(DEBUG) { System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Given "+adevice+ " - "+GLContext.getGLVersion(major, minor, ctxProfileBits, glVersion)+ ", Number(Str) "+hasGLVersionByString); System.err.println(getThreadName() + ": GLContext.setGLFuncAvail: Pre version verification - expected "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+", strictMatch "+strictMatch+", glVersionsMapping " +withinGLVersionsMapping); final boolean getGLIntVersionOK = getGLIntVersion(glIntMajor, glIntMinor); if( !getGLIntVersionOK ) { final String errMsg = "Fetching GL Integer Version failed. "+adevice+" - "+GLContext.getGLVersion(major, minor, ctxProfileBits, null); if( strictMatch ) { System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL version mismatch (Int): "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+hasGLVersionByInt); System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL version mismatch (String): "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+hasGLVersionByString); System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, GL3/ES3 version Int failed, String: "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion+", "+hasGLVersionByString); System.err.println(getThreadName() + ": GLContext.setGLFuncAvail.X: FAIL, No GL version validation possible: "+GLContext.getGLVersion(major, minor, ctxProfileBits, null)+" -> "+glVersion); GLContext.getGLVersion(reqGLVersion.getMajor(), reqGLVersion.getMinor(), reqCtxProfileBits, null)+" -> has "+ GLContext.getGLVersion(major, minor, ctxProfileBits, null)+ ", strictMatch "+strictMatch+", versionValidated "+versionValidated+", versionGL3IntOK "+versionGL3IntOK);