summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2009-10-02 14:54:42 -0700
committerSven Gothel <[email protected]>2009-10-02 14:54:42 -0700
commit56cc5d5058f352d0a46679b67d4f6650e457cbb9 (patch)
tree82ddac98b354258fb70669dbcaf5c7a9ec31cde3
parent966fc409d440f6c4d0ff9dab38f0f83ada36735f (diff)
NEWT Intel GDL: Surface Size tuning .. ; Add missing getSurfaceHandle()
-rw-r--r--src/newt/classes/com/sun/javafx/newt/intel/gdl/Window.java10
-rw-r--r--src/newt/native/IntelGDL.c27
2 files changed, 25 insertions, 12 deletions
diff --git a/src/newt/classes/com/sun/javafx/newt/intel/gdl/Window.java b/src/newt/classes/com/sun/javafx/newt/intel/gdl/Window.java
index 2c68a2054..3e4b5b90e 100644
--- a/src/newt/classes/com/sun/javafx/newt/intel/gdl/Window.java
+++ b/src/newt/classes/com/sun/javafx/newt/intel/gdl/Window.java
@@ -78,7 +78,7 @@ public class Window extends com.sun.javafx.newt.Window {
if(visible && 0==surfaceHandle) {
synchronized(Window.class) {
AbstractGraphicsDevice aDevice = screen.getDisplay().getGraphicsDevice();
- surfaceHandle = CreateSurface(aDevice.getHandle(), width, height);
+ surfaceHandle = CreateSurface(aDevice.getHandle(), screen.getWidth(), screen.getHeight(), x, y, width, height);
}
if (surfaceHandle == 0) {
throw new NativeWindowException("Error creating window");
@@ -117,6 +117,10 @@ public class Window extends com.sun.javafx.newt.Window {
((Display)screen.getDisplay()).setFocus(this);
}
+ public long getSurfaceHandle() {
+ return surfaceHandle;
+ }
+
//----------------------------------------------------------------------
// Internals only
//
@@ -126,7 +130,9 @@ public class Window extends com.sun.javafx.newt.Window {
private native void CloseSurface(long displayHandle, long surfaceHandle);
- private void updateSize(int width, int height) {
+ private void updateBounds(int x, int y, int width, int height) {
+ this.x = x;
+ this.y = y;
this.width = width;
this.height = height;
}
diff --git a/src/newt/native/IntelGDL.c b/src/newt/native/IntelGDL.c
index 44eccbc79..1ea576297 100644
--- a/src/newt/native/IntelGDL.c
+++ b/src/newt/native/IntelGDL.c
@@ -57,7 +57,7 @@
#endif
static jmethodID screenCreatedID = NULL;
-static jmethodID updateSizeID = NULL;
+static jmethodID updateBoundsID = NULL;
#define NUM_PLANES 5
static jobject newtWindows[NUM_PLANES] = { NULL, NULL, NULL, NULL, NULL } ;
@@ -237,8 +237,8 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_intel_gdl_Screen_GetScreenInfo
JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_initIDs
(JNIEnv *env, jclass clazz)
{
- updateSizeID = (*env)->GetMethodID(env, clazz, "updateSize", "(II)V");
- if (updateSizeID == NULL) {
+ updateBoundsID = (*env)->GetMethodID(env, clazz, "updateBounds", "(IIII)V");
+ if (updateBoundsID == NULL) {
DBG_PRINT("initIDs failed\n" );
return JNI_FALSE;
}
@@ -247,7 +247,7 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_initIDs
}
JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_CreateSurface
- (JNIEnv *env, jobject obj, jlong displayHandle, jint width, jint height) {
+ (JNIEnv *env, jobject obj, jlong displayHandle, jint scr_width, jint scr_height, jint x, jint y, jint width, jint height) {
gdl_driver_info_t * p_driver_info = (gdl_driver_info_t *) (intptr_t) displayHandle;
gdl_ret_t retval;
@@ -264,15 +264,22 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_CreateSurface
return 0;
}
- DBG_PRINT("[CreateSurface: width %d height %d plane %d]\n", width, height, plane);
+ DBG_PRINT("[CreateSurface: screen %dx%d, win %d/%d %dx%d plane %d]\n",
+ scr_width, scr_height, x, y, width, height, plane);
srcRect.origin.x = 0;
srcRect.origin.y = 0;
- srcRect.width = width;
- srcRect.height = height;
+ srcRect.width = scr_width;
+ srcRect.height = scr_height;
- dstRect.origin.x = 0;
- dstRect.origin.y = 0;
+ /** Overwrite - TEST - Check semantics of dstRect! */
+ x = 0;
+ y = 0;
+ width = scr_width;
+ height = scr_height;
+
+ dstRect.origin.x = x;
+ dstRect.origin.y = y;
dstRect.width = width;
dstRect.height = height;
@@ -325,7 +332,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_intel_gdl_Window_CreateSurface
return (jlong)0;
}
- (*env)->CallVoidMethod(env, obj, updateSizeID, (jint)width, (jint)height);
+ (*env)->CallVoidMethod(env, obj, updateBoundsID, (jint)x, (jint)y, (jint)width, (jint)height);
DBG_PRINT("[CreateSurface] returning plane %d\n", plane);