summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Meyer <[email protected]>2009-07-28 17:34:20 -0400
committerMorris Meyer <[email protected]>2009-07-28 17:39:14 -0400
commitb6d75cac68340878b20d35b23c8449c97ad9d819 (patch)
tree2cbd05b91739249458ea5f4e18556601ac2b9c2a
parentd73af059e836943fa37b9f7aab93154f530763d9 (diff)
EGL changes for device
-rw-r--r--make/build-newt.xml1
-rw-r--r--src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java19
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java6
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java14
-rwxr-xr-xsrc/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java2
-rw-r--r--src/jogl/classes/javax/media/opengl/GLProfile.java6
-rw-r--r--src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java11
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java5
-rwxr-xr-xsrc/newt/native/BroadcomEGL.c4
9 files changed, 55 insertions, 13 deletions
diff --git a/make/build-newt.xml b/make/build-newt.xml
index 48c11f6dd..1ed039a57 100644
--- a/make/build-newt.xml
+++ b/make/build-newt.xml
@@ -371,6 +371,7 @@
<linker id="linker.cfg.linux.newt.broadcom_egl" extends="linker.cfg.linux">
<syslibset dir="/nfsroot/lg/lib" libs="EglUtil"/>
+ <syslibset dir="/nfsroot/lg/lib" libs="nexus"/>
</linker>
<linker id="linker.cfg.linux.newt.x11" extends="linker.cfg.linux">
diff --git a/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java b/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java
index c381f68f5..e71cf33a0 100644
--- a/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java
+++ b/src/jogl/classes/com/sun/opengl/impl/GLDrawableImpl.java
@@ -52,7 +52,24 @@ public abstract class GLDrawableImpl implements GLDrawable {
this.factory = factory;
this.component = comp;
this.realized = realized;
- this.requestedCapabilities = (GLCapabilities)component.getGraphicsConfiguration().getNativeGraphicsConfiguration().getRequestedCapabilities(); // a copy ..
+
+ AbstractGraphicsConfiguration agc = component.getGraphicsConfiguration();
+ if (agc == null) {
+ System.out.println("GLDrawableImpl no AbstractGraphicsConfiguration");
+ System.out.println(component.getClass().getName());
+ return;
+ }
+ AbstractGraphicsConfiguration ngc = agc.getNativeGraphicsConfiguration();
+ if (ngc == null) {
+ System.out.println("GLDrawableImpl no native AbstractGraphicsConfiguration");
+ return;
+ }
+ Capabilities caps = ngc.getRequestedCapabilities();
+ if (caps == null) {
+ System.out.println("GLDrawableImpl no native Capabilities");
+ return;
+ }
+ this.requestedCapabilities = (GLCapabilities)caps; // a copy ..
}
/**
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java
index 396580c1d..e2ee65d27 100755
--- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDrawableFactory.java
@@ -45,15 +45,19 @@ import com.sun.gluegen.runtime.NativeLibrary;
public class EGLDrawableFactory extends GLDrawableFactoryImpl {
static {
+ try {
// Register our GraphicsConfigurationFactory implementations
// The act of constructing them causes them to be registered
new EGLGraphicsConfigurationFactory();
// Check for other underlying stuff ..
- if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(false))) {
+ /* if(NativeWindowFactory.TYPE_X11.equals(NativeWindowFactory.getNativeWindowType(false))) {
try {
NWReflection.createInstance("com.sun.opengl.impl.x11.glx.X11GLXGraphicsConfigurationFactory");
} catch (Throwable t) {}
+ } */
+ } catch (Throwable th) {
+ th.printStackTrace();
}
}
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java
index 8bed0eb35..99f163ca1 100755
--- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLDynamicLookupHelper.java
@@ -50,7 +50,7 @@ import com.sun.gluegen.runtime.DynamicLookupHelper;
* Currently two implementations exist, one for ES1 and one for ES2.
*/
public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper {
- protected static final boolean DEBUG = com.sun.opengl.impl.Debug.debug("EGL");
+ protected static final boolean DEBUG = true; /* com.sun.opengl.impl.Debug.debug("EGL"); */
private static final EGLDynamicLookupHelper eglES1DynamicLookupHelper;
private static final EGLDynamicLookupHelper eglES2DynamicLookupHelper;
@@ -136,9 +136,13 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper {
private NativeLibrary loadFirstAvailable(List/*<String>*/ libNames, ClassLoader loader) {
for (Iterator iter = libNames.iterator(); iter.hasNext(); ) {
- NativeLibrary lib = NativeLibrary.open((String) iter.next(), loader, false /*global*/);
+ String libname = (String) iter.next();
+ NativeLibrary lib = NativeLibrary.open(libname, loader, false /*global*/);
if (lib != null) {
+ System.out.println("found: " + libname);
return lib;
+ } else {
+ System.out.println("looked for: " + libname);
}
}
return null;
@@ -164,9 +168,11 @@ public abstract class EGLDynamicLookupHelper implements DynamicLookupHelper {
// EGL libraries ..
lib = loadFirstAvailable(eglLibNames, loader);
if (lib == null) {
- throw new GLException("Unable to dynamically load EGL library for profile ES" + esProfile);
+ // throw new GLException("Unable to dynamically load EGL library for profile ES" + esProfile);
+ System.out.println("Unable to dynamically load EGL library for profile ES" + esProfile);
+ } else {
+ glesLibraries.add(lib);
}
- glesLibraries.add(lib);
}
if (esProfile==2) {
diff --git a/src/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java b/src/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java
index 7e60e25c0..68630344a 100755
--- a/src/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java
+++ b/src/jogl/classes/com/sun/opengl/impl/egl/EGLES1DynamicLookupHelper.java
@@ -58,6 +58,8 @@ public class EGLES1DynamicLookupHelper extends EGLDynamicLookupHelper {
protected List/*<String>*/ getGLESLibNames() {
List/*<String>*/ glesLibNames = new ArrayList();
+ glesLibNames.add("nexus");
+
glesLibNames.add("GLES_CM");
glesLibNames.add("GLES_CL");
glesLibNames.add("GLESv1_CM");
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index ead5f6396..83a9b0098 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -54,7 +54,7 @@ import com.sun.nativewindow.impl.jvm.JVMUtil;
* or more specialized versions using the other static GetProfile methods.
*/
public class GLProfile implements Cloneable {
- public static final boolean DEBUG = Debug.debug("GLProfile");
+ public static final boolean DEBUG = true; /* Debug.debug("GLProfile"); */
//
// Public (user-visible) profiles
@@ -736,8 +736,8 @@ public class GLProfile implements Cloneable {
}
}
mappedProfiles = _mappedProfiles; // final ..
- if(null==defaultGLProfile) {
- throw new GLException("No profile available: "+list2String(GL_PROFILE_LIST_ALL));
+ if (null==defaultGLProfile) {
+ System.out.println("No profile available: "+list2String(GL_PROFILE_LIST_ALL));
}
}
diff --git a/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java b/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java
index b13cf4317..d054c205b 100644
--- a/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java
+++ b/src/nativewindow/classes/com/sun/nativewindow/impl/NWReflection.java
@@ -40,7 +40,7 @@ import java.lang.reflect.*;
import javax.media.nativewindow.*;
public final class NWReflection {
- public static final boolean DEBUG = Debug.debug("NWReflection");
+ public static final boolean DEBUG = true; /* Debug.debug("NWReflection"); */
public static final boolean isClassAvailable(String clazzName) {
try {
@@ -69,7 +69,11 @@ public final class NWReflection {
try {
factory = factoryClass.getDeclaredConstructor( cstrArgTypes );
} catch(NoSuchMethodException nsme) {
- throw new NativeWindowException("Constructor: '" + clazzName + "("+cstrArgTypes+")' not found");
+ nsme.printStackTrace();
+ throw new NativeWindowException("Constructor: '" + clazzName + "("+cstrArgTypes+")' not found");
+ } catch (Throwable th) {
+ th.printStackTrace();
+ throw new NativeWindowException(th);
}
return factory;
} catch (Throwable e) {
@@ -91,6 +95,9 @@ public final class NWReflection {
factory = getConstructor(clazzName, cstrArgTypes);
return factory.newInstance( cstrArgs ) ;
} catch (Exception e) {
+ if (DEBUG) {
+ e.printStackTrace();
+ }
throw new NativeWindowException(e);
}
}
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index cbd485649..d4684c783 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -48,6 +48,9 @@ import com.sun.nativewindow.impl.jvm.JVMUtil;
public abstract class NativeWindowFactory {
protected static final boolean DEBUG = Debug.debug("NativeWindow");
+ /** Broadcom EGL type */
+ public static final String TYPE_BROADCOM_EGL = "BroadcomEGL";
+
/** OpenKODE/EGL type */
public static final String TYPE_EGL = "EGL";
@@ -82,6 +85,8 @@ public abstract class NativeWindowFactory {
private static String _getNativeWindowingType(String osNameLowerCase) {
if (osNameLowerCase.startsWith("kd")) {
return TYPE_EGL;
+ } else if (osNameLowerCase.startsWith(TYPE_BROADCOM_EGL.toLowerCase())) {
+ return TYPE_BROADCOM_EGL;
} else if (osNameLowerCase.startsWith("wind")) {
return TYPE_WINDOWS;
} else if (osNameLowerCase.startsWith("mac os x") ||
diff --git a/src/newt/native/BroadcomEGL.c b/src/newt/native/BroadcomEGL.c
index 8afa71a47..55ca5f155 100755
--- a/src/newt/native/BroadcomEGL.c
+++ b/src/newt/native/BroadcomEGL.c
@@ -85,7 +85,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_broadcom_BCEGLDisplay_Cr
{
(void) env;
(void) obj;
- EGLDisplay dpy = EGLUtil_CreateDisplay( (GLuint) width, (GLuint) height );
+ EGLDisplay dpy = EGLUtil_CreateDisplayByNative( (GLuint) width, (GLuint) height );
if(NULL==dpy) {
fprintf(stderr, "[CreateDisplay] failed: NULL\n");
} else {
@@ -131,7 +131,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_broadcom_BCEGLWindow_Cre
return 0;
}
- window = EGLUtil_CreateWindow( dpy, chromaKey, &uiWidth, &uiHeight );
+ window = EGLUtil_CreateWindowByNative( dpy, chromaKey, &uiWidth, &uiHeight );
// EGLUtil_DestroyWindow( dpy, window );
if(NULL==window) {