So here is some feedback on my migration:
Pulled everything back into eclipse (just much better for refactoring)
Some simple text ‘Search and Replace’ of the following:
GL. -> GL2. final GL gl -> final GL2 gl GL gl = drawable.getGL(); -> GL2 gl = drawable.getGL().getGL2();
Followed by a Reorganise Imports at project level (added the ‘all’ jars just to get going)
Next I needed to implement the following new method in all classes implementing GLEventListener
:
public void dispose(final GLAutoDrawable drawable){}
I haven’t worked out if anything needs to be done within the method, or if I need to call it yet.
Next I needed to identify all the jars/natives required. Thanks to bienator for pointing to the new NetBeans plugin which helped me identify required files.
So this is what I’m currently using.
gluegen-rt.jar
jogl.all.jar
libgluegen-rt.jnilib
libjogl_gl2.jnilib
libnativewindow_awt.jnilib
libnativewindow_jvm.jnilib
libnewt.jnilib
nativewindow.all.jar
newt.all.jar
eclipse users: with JOGL 1 I always needed the natives in the root of my project for eclipse to find them for some reason. Anyway, I’m using an updated eclipse and found something that may have been there before, but maybe I overlooked. After adding the JOGL jars in build path of project properties, if you click the jars, you can specify the location of the appropriate associated natives files, which can be within a subdirectory of your project. Keeps things a bit cleaner
The next thing that tripped me up was a missing GLU utility method : gluBuild2DMipmaps
. I think the team is aware of this. But to make some progress I switched my custom Texture loading over to the TextureIO class. So far that’s working out quite nice with a bit less code on my side to maintain!
Now I’m down to about 10 errors in my project, some of them are related to some offscreen rendering in a utility class, so not an urgent fix, but will post some feedback if I discover anything strange in that migration step.
Finally I need to work out the new applet/webstart packaging and then I’ll be ready to demo my updated game play
Overall the migration has gone fairly smoothly, mostly thanks to feedback & support from users here!
Update: The utility code also turned out to be quite easy to fix, getFactory just needed a profile:
GLDrawableFactory.getFactory(GLProfile.get(GLProfile.GL2))