Posted by
Electra on
Jan 26, 2022; 4:07pm
URL: https://forum.jogamp.org/Unable-to-determine-Graphics-Configuration-Am-I-setting-up-something-wrong-tp4041606.html
I've recently started trying to set up JOGL in order to learn OpenGL with Java. I'm using Eclipse 2021-06, and have set up my project in the following way:
JOGL >
src >
gltest >
GLTest.java
module-info.java
gluegen-rt.jar
gluegen-rt-natives-windows-amd64.jar
gluegen-rt-natives-windows-i586.jar
jogl-all.jar
jogl-all-natives-windows-amd64.jar
jogl-all-natives-windows-i586.jar
My build path contains:
JavaSE-11 (jdk11.0.13)
gluegen-rt.jar
jogl-all.jar
I have tried adding the natives jars to the build path as well, with the same results.
My module-info.java contains:
module jogl {
requires jogl.all;
requires java.desktop;
}
My GLTest.java contains:
package gltest;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import com.jogamp.opengl.GLCapabilities;
import com.jogamp.opengl.GLProfile;
import com.jogamp.opengl.awt.GLCanvas;
public class GLTest {
public static void main ( final String[] args ) {
final GLProfile glp = GLProfile.getDefault();
final GLCapabilities caps = new GLCapabilities( glp );
final GLCanvas canvas = new GLCanvas( caps );
final Frame frame = new Frame();
frame.setSize( 500, 500 );
frame.add( canvas );
frame.setVisible( true );
frame.addWindowListener( new WindowAdapter() {
@Override
public void windowClosing ( final WindowEvent e ) {
System.exit( 0 );
}
} );
}
}
I'm using a standard run configuration for GLTest.java.
When I look at "manage run configurations" and click "Show Command Line", it shows:
C:\Program Files\Java\jdk-11.0.13\bin\javaw.exe
-Dfile.encoding=Cp1252
-p "C:\Users\user\eclipse-workspace\JOGL\bin;C:\Users\user\eclipse-workspace\JOGL\gluegen-rt.jar;C:\Users\user\eclipse-workspace\JOGL\jogl-all.jar"
-m jogl/gltest.GLTest
After running this, I get an error stating that it is unable to determine Graphics Configuration.
Exception in thread "main" com.jogamp.opengl.GLException: Unable to determine GraphicsConfiguration: WindowsWGLGraphicsConfiguration[DefaultGraphicsScreen[WindowsGraphicsDevice[type .windows, connection decon, unitID 0, handle 0x0, owner false, NullToolkitLock[obj 0xcb58c11]], idx 0], pfdID 9, ARB-Choosen true,
requested GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]],
chosen GLCaps[wgl vid 9 arb: rgba 8/8/8/0, opaque, accum-rgba 16/16/16/16, dp/st/ms 24/0/0, dbl, mono , hw, GLProfile[GL4bc/GL4bc.hw], on-scr[.]]]
at jogl.all/jogamp.opengl.windows.wgl.awt.WindowsAWTWGLGraphicsConfigurationFactory.chooseGraphicsConfigurationImpl(WindowsAWTWGLGraphicsConfigurationFactory.java:182)
at jogl.all/com.jogamp.nativewindow.GraphicsConfigurationFactory.chooseGraphicsConfiguration(GraphicsConfigurationFactory.java:424)
at jogl.all/com.jogamp.opengl.awt.GLCanvas.chooseGraphicsConfiguration(GLCanvas.java:1513)
at jogl.all/com.jogamp.opengl.awt.GLCanvas.addNotify(GLCanvas.java:609)
at java.desktop/java.awt.Container.addNotify(Container.java:2800)
at java.desktop/java.awt.Window.addNotify(Window.java:786)
at java.desktop/java.awt.Frame.addNotify(Frame.java:490)
at java.desktop/java.awt.Window.show(Window.java:1048)
at java.desktop/java.awt.Component.show(Component.java:1716)
at java.desktop/java.awt.Component.setVisible(Component.java:1663)
at java.desktop/java.awt.Window.setVisible(Window.java:1031)
at jogl/gltest.GLTest.main(GLTest.java:21)
I've looked up this issue, and keep finding the same things talking about various Java version inconsistencies:
https://github.com/jzy3d/jogl/issues/4https://forum.jogamp.org/JogAmp-Build-v2-4-0-rc-20210111-td4040955i20.htmlhttps://stackoverflow.com/questions/66722833/executable-jar-with-dependencies-and-dll-dependency-using-mavenMost of these seem to be reporting issues specifically with Java 15-17, though.
Initially, I was trying things on Java & JDK 13, and tried both of the command-line fixes suggested (illegal-access, and add-exports ALL UNNAMED). Nether seemed to work. Now, I've swapped over to Java & JDK 11, as it seemed like this was the version that people said worked. However, the error has not changed at all.
Thus, this kind of leads me to believe the issue isn't due to these errors others are mentioning, but to something more mundane. Can it actually not find the Graphics Configuration for some reason? Or am I setting up my project wrong?
For reference, I am on a Windows 10 ThinkPad P1 laptop. My friend was successfully able to set things up on a school Mac, so I'm not sure where our differences lie. Does this issue only happen on Windows? on laptops? on my particular setup?
I tried testing this with the OneTriangle example posted on the wiki somewhere, and got the same issue. If there was a test case I could very easily run without using Eclipse, that might be helpful in diagnosing the problem. I don't want to deal with this if it's going to require installing and running complicated Maven projects or anything, that would just add more hassle to this issue, ideally a simple command line & jar file / java file would do.
If anyone has ideas on what's going wrong or how I should try to diagnose this issue, please let me know. I've provided all the relevant info I can really think of, but if more detailed information would be necessary I can provide it. Thanks!