From da0391975092bbd1adce296477646b004c3562c3 Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Tue, 9 Aug 2011 20:17:11 +0200
Subject: EGL Fixes ...

- EGLDrawableFactory: createProxySurfaceImpl: add proper config choosing
- EGLCapabilities/EGLGraphicsConfiguration: Add nativeVisualID
- All: Avoid critical array access -> use NIO
---
 src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

(limited to 'src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java')

diff --git a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
index 509ef1f99..e0283abd7 100644
--- a/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/jogamp/opengl/egl/EGLDrawableFactory.java
@@ -44,7 +44,6 @@ import com.jogamp.common.JogampRuntimeException;
 import com.jogamp.common.util.*;
 
 import jogamp.opengl.*;
-import jogamp.opengl.x11.glx.X11GLXContext;
 import jogamp.nativewindow.WrappedSurface;
 
 import java.util.HashMap;
@@ -276,10 +275,14 @@ public class EGLDrawableFactory extends GLDrawableFactoryImpl {
         return ns;
     }
 
-    protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice device, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {    
-        WrappedSurface ns = new WrappedSurface(EGLGraphicsConfigurationFactory.createOffscreenGraphicsConfiguration(device, capsRequested, capsRequested, chooser), windowHandle);
+    protected ProxySurface createProxySurfaceImpl(AbstractGraphicsDevice adevice, long windowHandle, GLCapabilitiesImmutable capsRequested, GLCapabilitiesChooser chooser) {    
+        // FIXME device/windowHandle -> screen ?!
+        EGLGraphicsDevice device = (EGLGraphicsDevice) adevice;
+        DefaultGraphicsScreen screen = new DefaultGraphicsScreen(device, 0);
+        EGLGraphicsConfiguration cfg = EGLGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(capsRequested, capsRequested, chooser, screen);
+        WrappedSurface ns = new WrappedSurface(cfg, windowHandle);
         return ns;
-    }    
+    }
     
     protected GLContext createExternalGLContextImpl() {
         AbstractGraphicsScreen absScreen = DefaultGraphicsScreen.createDefault(NativeWindowFactory.TYPE_EGL);
-- 
cgit v1.2.3