summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--make/build-jogl.xml10
-rw-r--r--make/build-nativewindow.xml2
-rw-r--r--make/build-newt.xml4
-rwxr-xr-xmake/config/jogl/eglext.cfg3
-rwxr-xr-xmake/stub_includes/egl/EGL/egl.h5
-rw-r--r--src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java4
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/Display.java3
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/NewtFactory.java3
-rw-r--r--src/newt/classes/com/sun/javafx/newt/opengl/egl/EGLDisplay.java85
9 files changed, 111 insertions, 8 deletions
diff --git a/make/build-jogl.xml b/make/build-jogl.xml
index c48745da7..290ed67ca 100644
--- a/make/build-jogl.xml
+++ b/make/build-jogl.xml
@@ -1204,6 +1204,10 @@
<syslibset dir="/usr/X11R6/lib" libs="Xxf86vm" />
</linker>
+ <linker id="linker.cfg.linux.jogl.egl" extends="linker.cfg.linux">
+ <syslibset dir="/nfsroot/lg/lib" libs="EglUtil"/>
+ </linker>
+
<linker id="linker.cfg.linux.jogl.gl2" extends="linker.cfg.linux.jogl.x11">
<syslibset dir="/usr/X11R6/lib" libs="GL"/>
</linker>
@@ -1331,7 +1335,11 @@
<property name="linker.cfg.id.cg" value="linker.cfg.linux.jogl.cg" />
</target>
- <target name="c.configure.linux" depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.x11" if="isLinux" />
+ <target name="c.configure.linux"
+ depends="c.configure.linux.x86,c.configure.linux.amd64,c.configure.linux.ia64,c.configure.x11"
+ if="isLinux">
+ <property name="linker.cfg.id.egl" value="linker.cfg.linux.jogl.egl" />
+ </target>
<target name="c.configure.solaris32" depends="c.configure.x11" if="isSolaris32Bit">
<echo message="Solaris" />
diff --git a/make/build-nativewindow.xml b/make/build-nativewindow.xml
index 79e6b93ae..e19d75ba2 100644
--- a/make/build-nativewindow.xml
+++ b/make/build-nativewindow.xml
@@ -490,8 +490,6 @@
<!-- linker configuration -->
<linker id="linker.cfg.linux.nativewindow.x11" extends="linker.cfg.linux">
- <syslibset dir="/usr/X11R6/lib" libs="X11"/>
- <syslibset dir="/usr/X11R6/lib" libs="Xxf86vm" />
</linker>
<linker id="linker.cfg.linux.amd64.nativewindow.x11" extends="linker.cfg.linux.amd64">
diff --git a/make/build-newt.xml b/make/build-newt.xml
index 4895318e0..ee4b6ee17 100644
--- a/make/build-newt.xml
+++ b/make/build-newt.xml
@@ -137,7 +137,7 @@
value="com/sun/javafx/newt/macosx/*"/>
<property name="java.part.opengl"
- value="com/sun/javafx/newt/opengl/*, com/sun/javafx/newt/opengl/kd/*"/>
+ value="com/sun/javafx/newt/opengl/*, com/sun/javafx/newt/opengl/egl/*, com/sun/javafx/newt/opengl/kd/*"/>
<property name="java.part.awt"
value="com/sun/javafx/newt/awt/*"/>
@@ -367,8 +367,6 @@
<!-- linker configuration -->
<linker id="linker.cfg.linux.newt.x11" extends="linker.cfg.linux">
- <syslibset dir="/usr/X11R6/lib" libs="X11"/>
- <syslibset dir="/usr/X11R6/lib" libs="Xxf86vm" />
</linker>
<linker id="linker.cfg.linux.amd64.newt.x11" extends="linker.cfg.linux.amd64">
diff --git a/make/config/jogl/eglext.cfg b/make/config/jogl/eglext.cfg
index bdd9a3655..0447dd1e4 100755
--- a/make/config/jogl/eglext.cfg
+++ b/make/config/jogl/eglext.cfg
@@ -124,3 +124,6 @@ Ignore eglTerminate
Ignore eglWaitClient
Ignore eglWaitGL
Ignore eglWaitNative
+
+Ignore EGLUtil_CreateDisplayByNative
+Ignore EGLUtil_CreateWindowByNative
diff --git a/make/stub_includes/egl/EGL/egl.h b/make/stub_includes/egl/EGL/egl.h
index 86ca4818f..5b4c4215c 100755
--- a/make/stub_includes/egl/EGL/egl.h
+++ b/make/stub_includes/egl/EGL/egl.h
@@ -297,6 +297,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
EGLNativePixmapType target);
+EGLAPI EGLDisplay EGLAPIENTRY EGLUtil_CreateDisplayByNative(EGLint w, EGLint h);
+
+EGLAPI EGLSurface EGLAPIENTRY EGLUtil_CreateWindowByNative(EGLDisplay dpy, EGLint xx,
+ EGLint *wvalue, EGLint *hvalue);
+
typedef void (* EGLAPIENTRY __EGLFuncPtr)(void);
EGLAPI __EGLFuncPtr eglGetProcAddress(const char *procname);
diff --git a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
index cbd485649..fd6eb458e 100644
--- a/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
+++ b/src/nativewindow/classes/javax/media/nativewindow/NativeWindowFactory.java
@@ -80,7 +80,7 @@ public abstract class NativeWindowFactory {
}
private static String _getNativeWindowingType(String osNameLowerCase) {
- if (osNameLowerCase.startsWith("kd")) {
+ if (osNameLowerCase.startsWith("kd") || osNameLowerCase.startsWith("linux")) {
return TYPE_EGL;
} else if (osNameLowerCase.startsWith("wind")) {
return TYPE_WINDOWS;
@@ -101,6 +101,8 @@ public abstract class NativeWindowFactory {
AccessControlContext acc = AccessController.getContext();
nativeOSNamePure = Debug.getProperty("os.name", false, acc);
nativeOSNameCustom = Debug.getProperty("nativewindow.ws.name", true, acc);
+ System.out.println(nativeOSNamePure);
+ System.out.println(nativeOSNameCustom);
if(null==nativeOSNameCustom||nativeOSNameCustom.length()==0) {
nativeOSNameCustom = nativeOSNamePure;
}
diff --git a/src/newt/classes/com/sun/javafx/newt/Display.java b/src/newt/classes/com/sun/javafx/newt/Display.java
index 5032477c9..bdac08dab 100755
--- a/src/newt/classes/com/sun/javafx/newt/Display.java
+++ b/src/newt/classes/com/sun/javafx/newt/Display.java
@@ -45,7 +45,8 @@ public abstract class Display implements Runnable {
{
Class displayClass = null;
if (NativeWindowFactory.TYPE_EGL.equals(type)) {
- displayClass = Class.forName("com.sun.javafx.newt.opengl.kd.KDDisplay");
+ // displayClass = Class.forName("com.sun.javafx.newt.opengl.kd.KDDisplay");
+ displayClass = Class.forName("com.sun.javafx.newt.opengl.egl.EGLDisplay");
} else if (NativeWindowFactory.TYPE_WINDOWS.equals(type)) {
displayClass = Class.forName("com.sun.javafx.newt.windows.WindowsDisplay");
} else if (NativeWindowFactory.TYPE_MACOSX.equals(type)) {
diff --git a/src/newt/classes/com/sun/javafx/newt/NewtFactory.java b/src/newt/classes/com/sun/javafx/newt/NewtFactory.java
index b5a555455..b88e1e49e 100755
--- a/src/newt/classes/com/sun/javafx/newt/NewtFactory.java
+++ b/src/newt/classes/com/sun/javafx/newt/NewtFactory.java
@@ -50,6 +50,7 @@ public abstract class NewtFactory {
* Create a Display entity, incl native creation
*/
public static Display createDisplay(String name) {
+ System.out.println("NewtFactory: NAME: " + name);
return Display.create(NativeWindowFactory.getNativeWindowType(true), name);
}
@@ -57,6 +58,8 @@ public abstract class NewtFactory {
* Create a Display entity using the given implementation type, incl native creation
*/
public static Display createDisplay(String type, String name) {
+ System.out.println("NewtFactory: TYPE: " + type);
+ System.out.println("NewtFactory: NAME: " + name);
return Display.create(type, name);
}
diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/egl/EGLDisplay.java b/src/newt/classes/com/sun/javafx/newt/opengl/egl/EGLDisplay.java
new file mode 100644
index 000000000..bebb7ccf2
--- /dev/null
+++ b/src/newt/classes/com/sun/javafx/newt/opengl/egl/EGLDisplay.java
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2008 Sun Microsystems, Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * - Redistribution of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * - Redistribution in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * Neither the name of Sun Microsystems, Inc. or the names of
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * This software is provided "AS IS," without a warranty of any kind. ALL
+ * EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES,
+ * INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A
+ * PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY EXCLUDED. SUN
+ * MICROSYSTEMS, INC. ("SUN") AND ITS LICENSORS SHALL NOT BE LIABLE FOR
+ * ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
+ * DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES. IN NO EVENT WILL SUN OR
+ * ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR
+ * DIRECT, INDIRECT, SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE
+ * DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY,
+ * ARISING OUT OF THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF
+ * SUN HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+ *
+ */
+
+package com.sun.javafx.newt.opengl.egl;
+
+import com.sun.javafx.newt.*;
+import com.sun.javafx.newt.impl.*;
+import com.sun.opengl.impl.egl.*;
+import javax.media.nativewindow.*;
+import javax.media.nativewindow.egl.*;
+
+public class EGLDisplay extends Display {
+
+ static {
+ NativeLibLoader.loadNEWT();
+
+ System.loadLibrary("EglUtil");
+ }
+
+ public static void initSingleton() {
+ // just exist to ensure static init has been run
+ }
+
+
+ public EGLDisplay() {
+ }
+
+ protected void createNative() {
+ try {
+ int windowWidth = 1920, windowHeight = 1080;
+ int width[] = { windowWidth };
+ int height[] = { windowHeight };
+ long eglDisplayHandle =
+ EGL.EGLUtil_CreateDisplayByNative(windowWidth, windowHeight);
+ long eglSurfaceHandle =
+ EGL.EGLUtil_CreateWindowByNative(eglDisplayHandle, 1,
+ width, 0, height, 0);
+ } catch (Throwable th) {
+ th.printStackTrace();
+ }
+ }
+
+ protected void closeNative() {
+ if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) {
+ EGL.eglTerminate(aDevice.getHandle());
+ }
+ }
+
+ protected void dispatchMessages() {
+ DispatchMessages();
+ }
+
+ private native void DispatchMessages();
+}
+