aboutsummaryrefslogtreecommitdiffstats
path: root/src/newt
diff options
context:
space:
mode:
authorsg215889 <[email protected]>2009-07-29 09:49:33 -0700
committersg215889 <[email protected]>2009-07-29 09:49:33 -0700
commit8883fa885e68cd21e8b8cd3343db0580913aebdf (patch)
tree3f2b97b0a5c32088290ad9702f15494b8ecd71dd /src/newt
parentfdd78c172dfb76ba868359b359e344eaaf08d6f8 (diff)
Fix: doxygen-all-pub.cfg; Add NativeWindow: surfaceSwap() and surfaceUpdated(); BroadcomEGL: Use custom surfaceSwap(); GLDrawableImpl's: Utilize NativeWindow's surfaceSwap() and surfaceUpdated(); Fix common enum of GL2ES1 and GL2GL3, merge them in GL
Diffstat (limited to 'src/newt')
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/Window.java6
-rw-r--r--src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java13
-rwxr-xr-xsrc/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java13
-rwxr-xr-xsrc/newt/native/BroadcomEGL.c17
4 files changed, 43 insertions, 6 deletions
diff --git a/src/newt/classes/com/sun/javafx/newt/Window.java b/src/newt/classes/com/sun/javafx/newt/Window.java
index a1168d12d..e2903bd62 100755
--- a/src/newt/classes/com/sun/javafx/newt/Window.java
+++ b/src/newt/classes/com/sun/javafx/newt/Window.java
@@ -269,6 +269,12 @@ public abstract class Window implements NativeWindow
y=0;
}
+ public boolean surfaceSwap() {
+ return false;
+ }
+
+ public void surfaceUpdated() {}
+
protected void clearEventMask() {
eventMask=0;
}
diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
index 8ecfe6216..7a7ff0859 100644
--- a/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
+++ b/src/newt/classes/com/sun/javafx/newt/opengl/GLWindow.java
@@ -654,6 +654,19 @@ public class GLWindow extends Window implements GLAutoDrawable {
return null;
}
+ public boolean surfaceSwap() {
+ if(null!=drawable) return drawable.getNativeWindow().surfaceSwap();
+ return super.surfaceSwap();
+ }
+
+ public void surfaceUpdated() {
+ if(null!=drawable) {
+ drawable.getNativeWindow().surfaceUpdated();
+ } else {
+ super.surfaceUpdated();
+ }
+ }
+
public long getWindowHandle() {
if(null!=drawable) return drawable.getNativeWindow().getWindowHandle();
return super.getWindowHandle();
diff --git a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java b/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java
index 10e70baa0..ddee07c49 100755
--- a/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java
+++ b/src/newt/classes/com/sun/javafx/newt/opengl/broadcom/BCEGLWindow.java
@@ -85,10 +85,10 @@ public class BCEGLWindow extends Window {
void setSizeImpl(int width, int height) {
if(0!=windowHandle) {
// n/a in BroadcomEGL
- System.err.println("setSize n/a in BroadcomEGL with realized window");
+ System.err.println("BCEGLWindow.setSizeImpl n/a in BroadcomEGL with realized window");
} else {
if(DEBUG_IMPLEMENTATION) {
- Exception e = new Exception("BCEGLWindow.setSize() "+this.width+"x"+this.height+" -> "+width+"x"+height);
+ Exception e = new Exception("BCEGLWindow.setSizeImpl() "+this.width+"x"+this.height+" -> "+width+"x"+height);
e.printStackTrace();
}
this.width = width;
@@ -107,6 +107,14 @@ public class BCEGLWindow extends Window {
return false;
}
+ public boolean surfaceSwap() {
+ if ( 0!=windowHandle ) {
+ SwapWindow(getDisplayHandle(), windowHandle);
+ return true;
+ }
+ return false;
+ }
+
//----------------------------------------------------------------------
// Internals only
//
@@ -114,6 +122,7 @@ public class BCEGLWindow extends Window {
protected static native boolean initIDs();
private native long CreateWindow(long eglDisplayHandle, boolean chromaKey, int width, int height);
private native void CloseWindow(long eglDisplayHandle, long eglWindowHandle);
+ private native void SwapWindow(long eglDisplayHandle, long eglWindowHandle);
private long realizeWindow(boolean chromaKey, int width, int height) {
diff --git a/src/newt/native/BroadcomEGL.c b/src/newt/native/BroadcomEGL.c
index 716f7d9ee..764fa9b16 100755
--- a/src/newt/native/BroadcomEGL.c
+++ b/src/newt/native/BroadcomEGL.c
@@ -51,10 +51,10 @@
typedef unsigned int GLuint;
-EGLDisplay EGLUtil_CreateDisplay( GLuint uiWidth, GLuint uiHeight );
+EGLDisplay EGLUtil_CreateDisplayByNative( GLuint uiWidth, GLuint uiHeight );
void EGLUtil_DestroyDisplay( EGLDisplay eglDisplay );
-EGLSurface EGLUtil_CreateWindow( EGLDisplay eglDisplay, /* bool */ GLuint bChromakey, GLuint *puiWidth, GLuint *puiHeight );
+EGLSurface EGLUtil_CreateWindowByNative( EGLDisplay eglDisplay, /* bool */ GLuint bChromakey, GLuint *puiWidth, GLuint *puiHeight );
void EGLUtil_DestroyWindow( EGLDisplay eglDisplay, EGLSurface eglSurface );
void EGLUtil_SwapWindow( EGLDisplay eglDisplay, EGLSurface eglSurface );
@@ -132,7 +132,6 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_broadcom_BCEGLWindow_Cre
}
window = EGLUtil_CreateWindowByNative( dpy, chromaKey, &uiWidth, &uiHeight );
- // EGLUtil_DestroyWindow( dpy, window );
if(NULL==window) {
fprintf(stderr, "[RealizeWindow.Create] failed: NULL\n");
@@ -161,10 +160,20 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_opengl_broadcom_BCEGLWindow_Cre
JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_broadcom_BCEGLWindow_CloseWindow
(JNIEnv *env, jobject obj, jlong display, jlong window)
{
- EGLDisplay dpy = (EGLDisplay)(intptr_t)display;
+ EGLDisplay dpy = (EGLDisplay) (intptr_t) display;
EGLSurface surf = (EGLSurface) (intptr_t) window;
EGLUtil_DestroyWindow(dpy, surf);
DBG_PRINT( "[CloseWindow]\n");
}
+JNIEXPORT void JNICALL Java_com_sun_javafx_newt_opengl_broadcom_BCEGLWindow_SwapWindow
+ (JNIEnv *env, jobject obj, jlong display, jlong window)
+{
+ EGLDisplay dpy = (EGLDisplay) (intptr_t) display;
+ EGLSurface surf = (EGLSurface) (intptr_t) window;
+ EGLUtil_SwapWindow( dpy, surf );
+
+ DBG_PRINT( "[SwapWindow]\n");
+}
+