This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
LWJGL and gcj
- From: Anthony Green <green at redhat dot com>
- To: java at gcc dot gnu dot org
- Date: Tue, 24 May 2005 23:25:13 -0700
- Subject: LWJGL and gcj
LWJGL provides another OpenGL binding for java among other things (see
lwjgl.org). I was able to build it after a little jawt fixing (patch
coming soon).
Unfortunately it doesn't run. They use a really nasty kludge that
doesn't work with gcj. For some reason,they require access to low-level
graphics info in their java code. The info they need isn't provided by
the high-level interfaces available to normal programs (like in
GraphicsDevice), so they use this trick to call methods on Sun's private
subclasses.
static int getScreenFromDevice(GraphicsDevice device) throws LWJGLException {
try {
Method getScreen_method = device.getClass().getMethod("getScreen", null);
Integer screen = (Integer)getScreen_method.invoke(device, null);
return screen.intValue();
etc
etc
They use this same trick to get a visualID from Sun's private
GraphicsConfiguration subclass.
We will either have to implement similar secret interfaces, or ask the
LWJGL folks to change their ways (if that's even possible), or both.
I don't plan on doing anything more with this right now. This was just
an FYI.
AG