aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/classes/com/sun/opengl/impl/GLContextImpl.java18
-rwxr-xr-xsrc/native/newt/X11Window.c11
2 files changed, 18 insertions, 11 deletions
diff --git a/src/classes/com/sun/opengl/impl/GLContextImpl.java b/src/classes/com/sun/opengl/impl/GLContextImpl.java
index 13b847e51..6bec8c1e5 100644
--- a/src/classes/com/sun/opengl/impl/GLContextImpl.java
+++ b/src/classes/com/sun/opengl/impl/GLContextImpl.java
@@ -226,7 +226,7 @@ public abstract class GLContextImpl extends GLContext {
// Helpers for various context implementations
//
- private Object createObject(String suffix) {
+ private Object createObject(String suffix, Class[] cstrArgs) {
String clazzName = null;
Class factoryClass = null;
Constructor factory = null;
@@ -246,11 +246,17 @@ public abstract class GLContextImpl extends GLContext {
throw new GLException(clazzName + " not yet implemented");
}
try {
- factory = factoryClass.getDeclaredConstructor(new Class[] { GLContextImpl.class });
+ factory = factoryClass.getDeclaredConstructor( cstrArgs );
} catch(NoSuchMethodException nsme) {
- throw new GLException(clazzName + "(GLContextImpl) not yet implemented / missing cstr");
+ throw new GLException("Constructor: '" + clazzName + "("+cstrArgs+")' not found");
}
- return factory.newInstance(new Object[] { this });
+ if(cstrArgs.length==0) {
+ return factory.newInstance(null);
+ }
+ if(cstrArgs[0].equals(GLContextImpl.class)) {
+ return factory.newInstance(new Object[] { this });
+ }
+ throw new GLException("Constructor: '" + clazzName + "("+cstrArgs[0]+")' not yet supported");
} catch (Exception e) {
throw new GLException(e);
}
@@ -258,7 +264,7 @@ public abstract class GLContextImpl extends GLContext {
/** Create the GL for this context. */
protected GL createGL() {
- GL gl = (GL) createObject("Impl");
+ GL gl = (GL) createObject("Impl", new Class[] { GLContextImpl.class } );
/* FIXME: refactor dependence on Java 2D / JOGL bridge
if (tracker != null) {
@@ -338,7 +344,7 @@ public abstract class GLContextImpl extends GLContext {
System.err.println(getThreadName() + ": !!! Initializing OpenGL extension address table for " + this);
}
if (glProcAddressTable == null) {
- glProcAddressTable = (ProcAddressTable) createObject("ProcAddressTable");
+ glProcAddressTable = (ProcAddressTable) createObject("ProcAddressTable", new Class[0]);
// FIXME: cache ProcAddressTables by capability bits so we can
// share them among contexts with the same capabilities
}
diff --git a/src/native/newt/X11Window.c b/src/native/newt/X11Window.c
index 3f08b5d49..1640a36fc 100755
--- a/src/native/newt/X11Window.c
+++ b/src/native/newt/X11Window.c
@@ -153,7 +153,7 @@ JNIEXPORT jboolean JNICALL Java_com_sun_javafx_newt_x11_X11Window_initIDs
positionChangedID = (*env)->GetMethodID(env, clazz, "positionChanged", "(II)V");
windowClosedID = (*env)->GetMethodID(env, clazz, "windowClosed", "()V");
windowDestroyedID = (*env)->GetMethodID(env, clazz, "windowDestroyed", "()V");
- windowCreatedID = (*env)->GetMethodID(env, clazz, "windowCreated", "(IJ)V");
+ windowCreatedID = (*env)->GetMethodID(env, clazz, "windowCreated", "(JJ)V");
sendMouseEventID = (*env)->GetMethodID(env, clazz, "sendMouseEvent", "(IIIII)V");
sendKeyEventID = (*env)->GetMethodID(env, clazz, "sendKeyEvent", "(IIIC)V");
if (sizeChangedID == NULL ||
@@ -216,7 +216,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow
if(pVisualQuery!=NULL) {
visual = pVisualQuery->visual;
depth = pVisualQuery->depth;
- visualID = pVisualQuery->visualid;
+ visualID = (jlong)pVisualQuery->visualid;
XFree(pVisualQuery);
pVisualQuery=NULL;
}
@@ -229,7 +229,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow
// try default ..
visual = XDefaultVisualOfScreen(scrn);
if(visual!=NULL) {
- visualID = visual->visualid;
+ visualID = (jlong)visual->visualid;
// try given VisualID on screen
memset(&visualTemplate, 0, sizeof(XVisualInfo));
visualTemplate.screen = scrn_idx;
@@ -239,7 +239,7 @@ JNIEXPORT jlong JNICALL Java_com_sun_javafx_newt_x11_X11Window_CreateWindow
if(pVisualQuery!=NULL) {
visual = pVisualQuery->visual;
depth = pVisualQuery->depth;
- visualID = pVisualQuery->visualid;
+ visualID = (jlong)pVisualQuery->visualid;
XFree(pVisualQuery);
pVisualQuery=NULL;
} else {
@@ -362,13 +362,14 @@ JNIEXPORT void JNICALL Java_com_sun_javafx_newt_x11_X11Window_DispatchMessages
XSelectInput(dpy, w, xevent_mask_win|xevent_mask_key|xevent_mask_ptr);
+ /**
if(0!=xevent_mask_ptr) {
XGrabPointer(dpy, w, True, xevent_mask_ptr,
GrabModeAsync, GrabModeAsync, w, None, CurrentTime);
}
if(0!=xevent_mask_key) {
XGrabKeyboard(dpy, w, True, GrabModeAsync, GrabModeAsync, CurrentTime);
- }
+ } */
}