|
Original code (probably from jogamp examples)
GLCapabilities capabilities = new GLCapabilities(GLProfile.get(GLProfile.GL2));
=>Exception in thread "main" javax.media.opengl.GLException: Profile GL2 is not available on WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]], but: [GLProfile[GL2ES2/GL4.hw], GLProfile[GL4/GL4.hw], GLProfile[GL3/GL3.hw], GLProfile[GL4/GL4.hw], GLProfile[GL4ES3/GL4.hw], GLProfile[GL2GL3/GL4.hw]]
Apparently, GL2 is no longer supported by the drivers...
Searches of jogamp for solution suggested:
GLCapabilities capabilities = new GLCapabilities(GLProfile.getMaxFixedFunc(true));
=>Exception in thread "main" javax.media.opengl.GLException: Profiles [GL4bc, GL3bc, GL2, GLES1] not available on device WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[]]
Nuts.
Try various alternatives:
GLCapabilities capabilities = new GLCapabilities(GLProfile.get(GLProfile.GL3));
GLCapabilities capabilities = new GLCapabilities(GLProfile.get(GLProfile.GL4));
Maybe it should be more generic, like:
GLCapabilities capabilities = new GLCapabilities(GLProfile.getMinimum(true));
However, these all fail later in the code whenever there is a:
GL2 gl = drawable.getGL().getGL2();
==>Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Not a GL2 implementation
Changed this to:
GL gl = drawable.getGL();
However, lots of methods are not implemented in the super interface!
gl.glShadeModel(GL2.GL_SMOOTH);
gl.glLightfv(GL2.GL_LIGHT0, GL2.GL_SPECULAR, specular, 0);
gl.glLightModelfv(GL2.GL_LIGHT_MODEL_AMBIENT, global_ambient, 0);
gl.glColorMaterial(GL2.GL_FRONT, GL2.GL_AMBIENT_AND_DIFFUSE);
gl.glMatrixMode(GL2.GL_PROJECTION);
...
How should this be done?
Many thanks.
|