As some here may be interested in this, FYI:
https://xith3d.dev.java.net/issues/show_bug.cgi?id=73
[quote]Here’s a preliminary LWJGL binding for Xith3D:
http://www.padcroft.org/cfmdobbie/xith3d/
lwjgl-libs.zip contains the LWJGL 0.89 binaries for Win32; lwjgl-src.zip contains the rendering code. No changes outside of the com.xith3d.render.lwjgl package structure have been made. A number of tests are included in com.xith3d.render.lwjgl.test.
This code is very much a translation of the JOGL work and shares a huge amount of code with it - maintaining both rendering layers will be hard work without some refactoring of duplicated code. I think this nicely demonstrates that another abstraction layer is required - while the current interface is pretty good for JOGL vs Java2D implementations, it’s way too low-level for implementing multiple OpenGL bindings at.
Known issues:
[]There are a couple of calls that haven’t been ported (IIRC all related to generating snapshots).
[]As I’ve only tested a single codepath (only one machine available to test) there are guaranteed to be a number of hidden issues - buffers that need rewinding, typos, BufferOverrunExceptions etc.
[]Xith3D has evolved against JOGL, so works the way JOGL prefers. LWJGL has to jump through hoops to comply with some parts of the interface, making some code downright ugly.
[]The required main-loop code as it currently stands basically sucks. More intelligence needs to be moved into the LWJGL CanvasPeerImpl to make it cleaner.
[*]It is written against the unofficial LWJGL 0.89, which is to be superceded within a couple of weeks by 0.9.
With those caveats, I am happy to state that this code contains the same functionality as the JOGL layer as of 28th March, 12:45pm.
Cheers,
Charlie.
[/quote]
Some lessons learned:
[]Input is an area that could do with an abstraction layer.
[]As noted, a higher-level OpenGL-binding abstraction layer is required.
[]If someone passes you an NIO buffer and you’re passing it straight to something that cares about the buffer position, it’s sure to need rewinding. (Sod’s Law of NIO Buffers.)
[]Xith3D has a number of dependencies that stop it fully achieving its aim of implementation independence, such as assuming the presence of an AWT Window, referring to AWTEvents, inheriting classes from Component etc. This isn’t necessarily bad - it just means the goal of the project may have to be adjusted.
[*]JOGL and LWJGL have approached some problems in subtly different ways, such as quadrics support and vertex/fragment program input. Maybe not a book, but you could certainly write a good size pamphlet detailing the differences and the reasons behind them!

