Jogl patch for use with different implementations

Hello all!

I’m not very familiar with forums, and I’m not sure if I need to create a new topic for this or use some older topic.

I’m currently trying to make Jogl running with GNU Classpath and the Escher AWT peers, and I’ve found this patch is required in order to let our own backends to work (maybe other patches will be needed in the future, the implementation is currently pretty at the beginning).

I don’t know the side effects in other part of the code, but it seems that anything is running correctly. I signed the Sun SCA in case this is needed, as so did the company I work for.

I write the patch here as the forum software does not let me to attach the file:

— src/classes/javax/media/opengl/GLCanvas.java.orig 2008-04-16 16:40:22.000000000 +0200
+++ src/classes/javax/media/opengl/GLCanvas.java 2008-04-16 16:40:26.000000000 +0200
@@ -64,7 +64,7 @@

private GLDrawableHelper drawableHelper = new GLDrawableHelper();
private GLDrawable drawable;

  • private GLContextImpl context;
  • private GLContext context;
    private boolean autoSwapBufferMode = true;
    private boolean sendReshape = false;

@@ -115,7 +115,7 @@
chooser,
new AWTGraphicsDevice(device))));
drawable = GLDrawableFactory.getFactory().getGLDrawable(this, capabilities, chooser);

  • context = (GLContextImpl) drawable.createContext(shareWith);
  • context = drawable.createContext(shareWith);
    context.setSynchronized(true);
    }

Thanks,
Mario Torre

Thanks for the patch. I’ve committed it.

Hey, thanks a lot :slight_smile:

Hello again!

I have another patch to make everything even more portable! :slight_smile:

Internally, Jogl extends GLContext, GLDrawableFactory and GLDrawable by mean of some generic, abstract classes, adds some functionality to these and then implements the specific classes in the various peers (X11, Windows and OSX, currently).

This is an implementation detail, but some of the methods are used directly in GLJPanel so I’ve moved the needed methods in some uplevel package, namely javax.media.opengl.peer.

This package is targeted at Jogl developers that need to port Jogl to other platform. The class documentation warn normal users to not use these classes unless they want to port Jogl.

The patch is currently located here:

Let me know what you think!

Thanks,
Mario

When you say that you are porting JOGL to another platform, what exactly do you mean?

We are in the process of refactoring the core JOGL classes to reduce dependencies on the AWT. More details to come in a separate thread. I don’t know whether this is your primary motivation but I’d like to defer discussion of the incorporation of a patch like this until we’re further along. I think the new JOGL core will be much easier to retarget to new platforms and toolkits.

Hi!

I’m porting Jogl to Escher and GNU Classpath.

You can find some screenshots and keep track of the progress on my blog: http://jroller.com/neugens

(for example: http://www.limasoftware.net/neugens/downloads/classpath/mozzarella/gear_demo.png)

I’m currently able to run the gear demo. If you need help during the refactoring, please tell me, and point me to the threads. I’m currently targeting the last jogl stable release, but I would definitely be happy to contribute to the main development branch. I have two reason to do this, the first is because my company needs Jogl for some internal projects, and the second is that, as a long time GNU Classpath developer, I’m always happy to make sure that Java software runs on this platform, so they assigned me the task to make Jogl (and Escher) running on Classpath as a natural result. Also, once done, we will use this project as a companion project to show our progresses on the AWT Portable Backend project (codename Caciocavallo, see http://mail.openjdk.java.net/pipermail/challenge-discuss/2008-March/000082.html).

Cheers,
Mario