diff options
author | Sven Gothel <[email protected]> | 2010-12-03 21:35:43 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2010-12-03 21:35:43 +0100 |
commit | 80352f4e9f95f358f50f44bf65d04b60f79821bf (patch) | |
tree | 0da7ea7eb75b88f2b97827ea4006bfd4b1cf1de1 | |
parent | a24f035234aee20ed23fe2ae4f701db5ec6db625 (diff) |
DEBUG: GLProfile: Dump GLInfo ; GLContext: SET mappedVersions.. no stack trace
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLContext.java | 6 | ||||
-rw-r--r-- | src/jogl/classes/javax/media/opengl/GLProfile.java | 60 |
2 files changed, 48 insertions, 18 deletions
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java index f76f2b664..72073deef 100644 --- a/src/jogl/classes/javax/media/opengl/GLContext.java +++ b/src/jogl/classes/javax/media/opengl/GLContext.java @@ -602,9 +602,9 @@ public abstract class GLContext { deviceVersionsAvailableSet.add(devKey); if (DEBUG0) { String msg = getThreadName() + ": !!! createContextARB: SET mappedVersionsAvailableSet "+devKey; - Throwable t = new Throwable(msg); - t.printStackTrace(); - // System.err.println(msg); + // Throwable t = new Throwable(msg); + // t.printStackTrace(); + System.err.println(msg); } } } diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 3bccc3b85..9c8d44af8 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -423,6 +423,17 @@ public class GLProfile { */ public static final String[] GL_PROFILE_LIST_GL2ES1 = new String[] { GL2ES1, GL2, GL3bc, GL4bc, GLES1 }; + /** + * All GLES Profiles in the order of default detection. + * + * <ul> + * <li> GLES2 + * <li> GLES1 + * </ul> + * + */ + public static final String[] GL_PROFILE_LIST_GLES = new String[] { GLES2, GLES1 }; + /** Returns a default GLProfile object, reflecting the best for the running platform. * It selects the first of the set {@link GLProfile#GL_PROFILE_LIST_ALL} * @see #GL_PROFILE_LIST_ALL @@ -1174,8 +1185,8 @@ public class GLProfile { } } - boolean addedAnyProfile = initProfilesForDevice(defaultDesktopDevice); - addedAnyProfile = addedAnyProfile || initProfilesForDevice(defaultEGLDevice); + boolean addedAnyProfile = initProfilesForDevice(defaultDesktopDevice) || + initProfilesForDevice(defaultEGLDevice); if(DEBUG) { System.err.println("GLProfile.init isAWTAvailable "+isAWTAvailable); @@ -1212,7 +1223,8 @@ public class GLProfile { return null != GLProfile.getDefault(device); } - boolean addedAnyProfile = false; + boolean addedDesktopProfile = false; + boolean addedEGLProfile = false; if( hasDesktopGL && desktopFactory.getIsDeviceCompatible(device)) { // 1st pretend we have all Desktop and EGL profiles .. @@ -1232,11 +1244,9 @@ public class GLProfile { 1, 5, GLContext.CTX_PROFILE_COMPAT|GLContext.CTX_OPTION_ANY); } computeProfileMap(device, false /* desktopCtxUndef*/, false /* eglCtxUndef */); - addedAnyProfile = null != GLProfile.getDefault(device); - } else { - if(DEBUG) { - System.err.println("GLProfile: DesktopFactory - Device is not available: "+device.getConnection()); - } + addedDesktopProfile = null != GLProfile.getDefault(device); + } else if(DEBUG) { + System.err.println("GLProfile: DesktopFactory - Device is not available: "+device.getConnection()); } if( null!=eglFactory && ( hasGLES2Impl || hasGLES1Impl ) && eglFactory.getIsDeviceCompatible(device)) { @@ -1264,22 +1274,42 @@ public class GLProfile { 1, 0, GLContext.CTX_PROFILE_ES|GLContext.CTX_OPTION_ANY); } computeProfileMap(device, false /* desktopCtxUndef*/, false /* eglCtxUndef */); - addedAnyProfile = addedAnyProfile || null != GLProfile.getDefault(device); - } else { - if(DEBUG) { - System.err.println("GLProfile: EGLFactory - Device is not available: "+device.getConnection()); - } + addedEGLProfile = null != GLProfile.get(device, GL_PROFILE_LIST_GLES); + } else if(DEBUG) { + System.err.println("GLProfile: EGLFactory - Device is not available: "+device.getConnection()); } + if(!GLContext.getAvailableGLVersionsSet(device)) { GLContext.setAvailableGLVersionsSet(device); } if (DEBUG) { - System.err.println("GLProfile.initProfilesForDevice: "+device.getConnection()+": added profile(s): "+addedAnyProfile); + System.err.println("GLProfile.initProfilesForDevice: "+device.getConnection()+": added profile(s): desktop "+addedDesktopProfile+", egl "+addedEGLProfile); System.err.println("GLProfile.initProfilesForDevice: "+device.getConnection()+": "+glAvailabilityToString(device)); + if(addedDesktopProfile) { + dumpGLInfo(desktopFactory, device); + } + if(addedEGLProfile) { + dumpGLInfo(eglFactory, device); + } } - return addedAnyProfile; + return addedDesktopProfile || addedEGLProfile; + } + + private static void dumpGLInfo(GLDrawableFactoryImpl factory, AbstractGraphicsDevice device) { + GLContext ctx = factory.getOrCreateSharedContext(device); + AbstractGraphicsDevice nativeDevice = ctx.getGLDrawable().getNativeSurface() + .getGraphicsConfiguration().getNativeGraphicsConfiguration() + .getScreen().getDevice(); + nativeDevice.unlock(); + try { + ctx.makeCurrent(); + System.err.println(JoglVersion.getGLInfo(ctx.getGL(), null)); + ctx.release(); + } finally { + nativeDevice.unlock(); + } } public static AbstractGraphicsDevice getDefaultDevice() { |