This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]