From f886eb1860189b5777c28eb99ddc70aaee8c865a Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Mon, 1 Aug 2011 22:08:55 +0200 Subject: GLProfile: Allow EGL besides desktop; Desktop factories restricted to desktop profiles Allow EGL besides desktop - Initialize EGL for default EGL device, even if desktop is available Desktop factories restricted to desktop profiles - Don't use native ES1/ES2 here .. --- src/jogl/classes/javax/media/opengl/GLProfile.java | 21 ++++++++++++++++++--- .../windows/wgl/WindowsWGLDrawableFactory.java | 2 +- .../opengl/x11/glx/X11GLXDrawableFactory.java | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) (limited to 'src/jogl/classes') diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java index 3a14bb8e3..f5f2e5389 100644 --- a/src/jogl/classes/javax/media/opengl/GLProfile.java +++ b/src/jogl/classes/javax/media/opengl/GLProfile.java @@ -365,6 +365,20 @@ public class GLProfile { */ public static final String[] GL_PROFILE_LIST_MIN = new String[] { GLES1, GLES2, GL2, GL3, GL3bc, GL4, GL4bc }; + /** + * Order of minimum original desktop profiles. + * + * + * + */ + public static final String[] GL_PROFILE_LIST_MIN_DESKTOP = new String[] { GL2, GL3bc, GL4bc, GL3, GL4 }; + /** * Order of maximum fixed function profiles * @@ -1260,11 +1274,12 @@ public class GLProfile { } } - final boolean addedAnyProfile = initProfilesForDevice(defaultDesktopDevice) || - initProfilesForDevice(defaultEGLDevice); + final boolean addedDesktopProfile = initProfilesForDevice(defaultDesktopDevice); + final boolean addedEGLProfile = initProfilesForDevice(defaultEGLDevice); + final boolean addedAnyProfile = addedDesktopProfile || addedEGLProfile ; if(DEBUG) { - System.err.println("GLProfile.init addedAnyProfile "+addedAnyProfile); + System.err.println("GLProfile.init addedAnyProfile(e/d) "+addedAnyProfile+" ("+addedDesktopProfile+"/"+addedEGLProfile+")"); System.err.println("GLProfile.init isAWTAvailable "+isAWTAvailable); System.err.println("GLProfile.init hasDesktopGLFactory "+hasDesktopGLFactory); System.err.println("GLProfile.init hasGL234Impl "+hasGL234Impl); diff --git a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java index cef0f0122..13bb24237 100644 --- a/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java @@ -273,7 +273,7 @@ public class WindowsWGLDrawableFactory extends GLDrawableFactoryImpl { if (null == absScreen) { throw new GLException("Couldn't create shared screen for device: "+sharedDevice+", idx 0"); } - GLProfile glp = GLProfile.getMinimum(sharedDevice); + GLProfile glp = GLProfile.get(sharedDevice, GLProfile.GL_PROFILE_LIST_MIN_DESKTOP); if (null == glp) { throw new GLException("Couldn't get default GLProfile for device: "+sharedDevice); } diff --git a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java index 872503b36..14f2a28f1 100644 --- a/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java +++ b/src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java @@ -181,7 +181,7 @@ public class X11GLXDrawableFactory extends GLDrawableFactoryImpl { if (null == sharedScreen) { throw new GLException("Couldn't create shared screen for device: "+sharedDevice+", idx 0"); } - GLProfile glp = GLProfile.getMinimum(sharedDevice); + GLProfile glp = GLProfile.get(sharedDevice, GLProfile.GL_PROFILE_LIST_MIN_DESKTOP); if (null == glp) { throw new GLException("Couldn't get default GLProfile for device: "+sharedDevice); } -- cgit v1.2.3