Jogamp
GLProfile: Allow EGL besides desktop; Desktop factories restricted to desktop profiles
authorSven Gothel <sgothel@jausoft.com>
Mon, 1 Aug 2011 20:08:55 +0000 (22:08 +0200)
committerSven Gothel <sgothel@jausoft.com>
Mon, 1 Aug 2011 20:08:55 +0000 (22:08 +0200)
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
src/jogl/classes/jogamp/opengl/windows/wgl/WindowsWGLDrawableFactory.java
src/jogl/classes/jogamp/opengl/x11/glx/X11GLXDrawableFactory.java

index 3a14bb8..f5f2e53 100644 (file)
@@ -366,6 +366,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.
+     *
+     * <ul>
+     *  <li> GL2
+     *  <li> GL3bc
+     *  <li> GL4bc
+     *  <li> GL3
+     *  <li> GL4
+     * </ul>
+     *
+     */
+    public static final String[] GL_PROFILE_LIST_MIN_DESKTOP = new String[] { GL2, GL3bc, GL4bc, GL3, GL4 };
+    
+    /**
      * Order of maximum fixed function profiles
      *
      * <ul>
@@ -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);
index cef0f01..13bb242 100644 (file)
@@ -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);
                 }
index 872503b..14f2a28 100644 (file)
@@ -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);
                 }
http://JogAmp.org git info: FAQ, tutorial and man pages.