diff options
Diffstat (limited to 'src')
4 files changed, 93 insertions, 2 deletions
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(); +} + |