diff options
Diffstat (limited to 'src/newt/classes')
3 files changed, 6 insertions, 29 deletions
diff --git a/src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java b/src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java index 3f360f20f..0a43c9b8f 100644 --- a/src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java +++ b/src/newt/classes/jogamp/newt/driver/android/AndroidDisplay.java @@ -32,9 +32,6 @@ import jogamp.newt.*; import jogamp.opengl.egl.*; import javax.media.nativewindow.*; -import javax.media.opengl.GLException; - -import com.jogamp.nativewindow.egl.*; public class AndroidDisplay extends jogamp.newt.DisplayImpl { static { @@ -55,20 +52,11 @@ public class AndroidDisplay extends jogamp.newt.DisplayImpl { protected void createNativeImpl() { // EGL Device - final long eglDisplay = EGLDisplayUtil.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY); - if (eglDisplay == EGL.EGL_NO_DISPLAY) { - throw new GLException("Failed to created EGL default display: error 0x"+Integer.toHexString(EGL.eglGetError())); - } - if (!EGLDisplayUtil.eglInitialize(eglDisplay, null, null)) { - throw new GLException("eglInitialize failed eglDisplay 0x"+Long.toHexString(eglDisplay)+", error 0x"+Integer.toHexString(EGL.eglGetError())); - } - aDevice = new EGLGraphicsDevice(eglDisplay, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); + aDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); } protected void closeNativeImpl() { - if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) { - EGLDisplayUtil.eglTerminate(aDevice.getHandle()); - } + aDevice.close(); } protected void dispatchMessagesNative() { diff --git a/src/newt/classes/jogamp/newt/driver/broadcom/egl/Display.java b/src/newt/classes/jogamp/newt/driver/broadcom/egl/Display.java index f90c62ff4..e3f50b7e0 100644 --- a/src/newt/classes/jogamp/newt/driver/broadcom/egl/Display.java +++ b/src/newt/classes/jogamp/newt/driver/broadcom/egl/Display.java @@ -61,11 +61,11 @@ public class Display extends jogamp.newt.DisplayImpl { } protected void createNativeImpl() { - long handle = CreateDisplay(Screen.fixedWidth, Screen.fixedHeight); + final long handle = CreateDisplay(Screen.fixedWidth, Screen.fixedHeight); if (handle == EGL.EGL_NO_DISPLAY) { throw new NativeWindowException("BC EGL CreateDisplay failed"); } - aDevice = new EGLGraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); + aDevice = new EGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, handle, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT, null); } protected void closeNativeImpl() { diff --git a/src/newt/classes/jogamp/newt/driver/kd/KDDisplay.java b/src/newt/classes/jogamp/newt/driver/kd/KDDisplay.java index 73bbe0b5b..07b031841 100644 --- a/src/newt/classes/jogamp/newt/driver/kd/KDDisplay.java +++ b/src/newt/classes/jogamp/newt/driver/kd/KDDisplay.java @@ -42,8 +42,6 @@ import jogamp.newt.NEWTJNILibLoader; import jogamp.opengl.egl.EGL; import jogamp.opengl.egl.EGLDisplayUtil; -import com.jogamp.nativewindow.egl.EGLGraphicsDevice; - public class KDDisplay extends DisplayImpl { static { @@ -64,20 +62,11 @@ public class KDDisplay extends DisplayImpl { protected void createNativeImpl() { // FIXME: map name to EGL_*_DISPLAY - long handle = EGLDisplayUtil.eglGetDisplay(EGL.EGL_DEFAULT_DISPLAY); - if (handle == EGL.EGL_NO_DISPLAY) { - throw new NativeWindowException("eglGetDisplay failed"); - } - if (!EGLDisplayUtil.eglInitialize(handle, null, null)) { - throw new NativeWindowException("eglInitialize failed"); - } - aDevice = new EGLGraphicsDevice(handle, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); + aDevice = EGLDisplayUtil.eglCreateEGLGraphicsDevice(EGL.EGL_DEFAULT_DISPLAY, AbstractGraphicsDevice.DEFAULT_CONNECTION, AbstractGraphicsDevice.DEFAULT_UNIT); } protected void closeNativeImpl() { - if (aDevice.getHandle() != EGL.EGL_NO_DISPLAY) { - EGLDisplayUtil.eglTerminate(aDevice.getHandle()); - } + aDevice.close(); } protected void dispatchMessagesNative() { |