diff options
author | Sven Gothel <[email protected]> | 2008-06-25 09:38:10 +0000 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2008-06-25 09:38:10 +0000 |
commit | 6e9438e631b9f75340c1f7e7cf06b38a358861c4 (patch) | |
tree | 9500137a98e187f5e1c09fdf037043613e333cbb /src | |
parent | 16f1e768f7a9162ac50cefc811a1fce019831bdf (diff) |
GLES1 NEWT X11 - RedSquare - working
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JOGL_2_SANDBOX@1683 232f8b59-042b-4e1e-8c03-345bb8c30851
Diffstat (limited to 'src')
-rw-r--r-- | src/classes/com/sun/opengl/impl/GLContextImpl.java | 18 | ||||
-rwxr-xr-x | src/native/newt/X11Window.c | 11 |
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); - } + } */ } |